akborana4 commited on
Commit
7628f39
·
verified ·
1 Parent(s): ad51789

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -12
Dockerfile CHANGED
@@ -1,36 +1,36 @@
1
- # --------- 1) Build the React client ----------
2
  FROM node:18-alpine AS client
3
  WORKDIR /app/client
4
 
5
  # Install client dependencies
6
  COPY client/package.json ./
7
  RUN npm install
8
-
9
- # Copy client source and build
10
  COPY client/ ./
11
  RUN npm run build
12
 
13
-
14
- # ---------- 2) Build the Node server ----------
15
  FROM node:18-alpine AS server
16
  WORKDIR /app/server
17
 
18
- # Install server dependencies
 
 
 
 
19
  COPY server/package.json ./
20
  RUN npm install
21
-
22
- # Copy server source
23
  COPY server/ ./
24
 
25
- # Copy built client into server's public folder
 
26
  COPY --from=client /app/client/dist ../client/dist
27
 
28
  # Environment
29
  ENV NODE_ENV=production
30
  ENV PORT=3000
 
 
 
31
 
32
- # Expose port for Hugging Face
33
  EXPOSE 3000
34
-
35
- # Start server
36
  CMD ["npm", "start"]
 
1
+ # ---------- 1) Build the React client ----------
2
  FROM node:18-alpine AS client
3
  WORKDIR /app/client
4
 
5
  # Install client dependencies
6
  COPY client/package.json ./
7
  RUN npm install
 
 
8
  COPY client/ ./
9
  RUN npm run build
10
 
11
+ # ---------- 2) Build the Node server with yt-dlp & ffmpeg ----------
 
12
  FROM node:18-alpine AS server
13
  WORKDIR /app/server
14
 
15
+ # Add Python, pip, ffmpeg, and yt-dlp for YouTube resolving
16
+ RUN apk add --no-cache python3 py3-pip ffmpeg && \
17
+ pip install --no-cache-dir yt-dlp
18
+
19
+ # Install server deps
20
  COPY server/package.json ./
21
  RUN npm install
 
 
22
  COPY server/ ./
23
 
24
+ # Bring in client build
25
+ RUN mkdir -p ../client/dist
26
  COPY --from=client /app/client/dist ../client/dist
27
 
28
  # Environment
29
  ENV NODE_ENV=production
30
  ENV PORT=3000
31
+ # Optional: path to cookies file in Netscape format for yt-dlp
32
+ # e.g. YT_COOKIES=/data/cookies.txt
33
+ # ENV YT_COOKIES=""
34
 
 
35
  EXPOSE 3000
 
 
36
  CMD ["npm", "start"]