# ---------- 1) Build the React client ---------- FROM node:18-alpine AS client WORKDIR /app/client # Install client dependencies 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 server dependencies COPY server/package.json ./ RUN npm install COPY server/ ./ # Bring in client build RUN mkdir -p ../client/dist COPY --from=client /app/client/dist ../client/dist # Environment ENV NODE_ENV=production ENV PORT=3000 # Provide your ytdl.php API key in HF Space settings: # Variables and secrets -> Add variable -> Name: YTDL_API_KEY Value: your-key ENV YTDL_API_KEY="akay" EXPOSE 3000 CMD ["npm", "start"]