Files
NewTube/docker/Dockerfile.origi
T
bruno 97e5de74f5
CI / build-and-test (push) Successful in 13m34s
feat(channel): page details chaine multi-providers avec onglets et infinite scroll
- Strategy Pattern front: ChannelProviderInterface + 6 providers (yt/dm/tw/pt/od/ru) + factory (ids longs/courts)
- ChannelContentService: cache par onglet/tri/recherche (TTL 5min), pagination nextPage
- ChannelPage: header (banniere/avatar/subs/description ...plus), tabs dynamiques par capabilities, grilles videos/shorts 9:16/playlists/live, recherche debounced, tri recent/populaire, infinite scroll IntersectionObserver, skeletons/empty/error
- Backend: GET /api/channels/:provider/:id/content (videos/shorts/playlists/live) natif par provider
2026-09-25 10:15:12 -04:00

71 lines
2.4 KiB
Docker

# syntax=docker/dockerfile:1
# -------------------- Build stage --------------------
FROM node:20-bookworm AS builder
WORKDIR /app
# Install dependencies
COPY package*.json ./
RUN npm ci
# Copy sources
COPY . .
# Build Angular app (outputs to ./dist)
RUN npx ng build --configuration=production
# Prune dev dependencies to keep only production deps for runtime copy
RUN npm prune --omit=dev
# -------------------- Runtime stage --------------------
FROM node:20-bookworm-slim AS runner
ENV NODE_ENV=production \
YOUTUBE_DL_SKIP_PYTHON_CHECK=1
WORKDIR /app
# Create required runtime directories
RUN mkdir -p /app/db /app/tmp/downloads
# youtube-dl-exec (yt-dlp) requires Python at runtime.
# curl_cffi is required by yt-dlp impersonation AND by the Rumble provider's
# Cloudflare bypass helper (server/providers/rumble_fetch.py).
RUN apt-get update \
&& apt-get install -y --no-install-recommends python3 python-is-python3 python3-pip ca-certificates curl \
&& rm -rf /var/lib/apt/lists/* \
&& python3 -m pip install --no-cache-dir --break-system-packages curl_cffi 2>/dev/null \
|| python3 -m pip install --no-cache-dir curl_cffi
# Copy runtime server and built frontend
COPY --from=builder /app/server ./server
COPY --from=builder /app/dist ./dist
# Copy the DB schema AND migrations; the actual DB file will be created on first run
COPY --from=builder /app/db/schema.sql ./db/schema.sql
COPY --from=builder /app/db/migrations ./db/migrations
## Also copy schema+migrations to an immutable location that won't be shadowed
## by a bind/named volume mounted on /app/db
RUN mkdir -p /app/db-schema /app/db-migrations
COPY --from=builder /app/db/schema.sql /app/db-schema/schema.sql
COPY --from=builder /app/db/migrations /app/db-migrations/
# Copy production dependencies from builder
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/package*.json ./
# Copy config
COPY --from=builder /app/assets/config.local.js ./assets/config.local.js
# Après la ligne COPY pour config.local.js
RUN ls -la /app/assets/ && \
echo "Contenu de config.local.js:" && \
cat /app/assets/config.local.js || echo "Fichier config.local.js non trouvé"
# Expose API/web port
EXPOSE 4000
# Healthcheck against API
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD curl -fsS http://localhost:4000/api/health || exit 1
# Start the API server (serves the Angular build from ./dist)
CMD ["node", "./server/index.mjs"]