Spaces:
Sleeping
Sleeping
File size: 870 Bytes
7628f39 c3c1f95 b951cf8 c3c1f95 1cefaba c3c1f95 b951cf8 9427dfc 1cefaba b951cf8 9427dfc b951cf8 9427dfc 7628f39 c3c1f95 b951cf8 06ed0b5 1cefaba |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# ---------- 1) Build the React client ----------
FROM node:18-alpine AS client
WORKDIR /app/client
COPY client/package.json ./
RUN npm install
COPY client/ ./
RUN npm run build
# ---------- 2) Build the Node server ----------
FROM node:18-alpine AS server
WORKDIR /app/server
# Install yt-dlp and Python
RUN addgroup -g 1001 -S nodejs && \
adduser -S nextjs -u 1001 && \
apk add --no-cache curl python3 py3-pip && \
curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
-o /usr/local/bin/yt-dlp && \
chmod a+rx /usr/local/bin/yt-dlp
# Install server dependencies
COPY server/package.json ./
RUN npm install
# Copy server source
COPY server/ ./
# Bring in built client
RUN mkdir -p ../client/dist
COPY --from=client /app/client/dist ../client/dist
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
CMD ["npm", "start"]
|