# Build stage FROM node:20-slim AS builder WORKDIR /app # Copy package files COPY package*.json ./ COPY frontend/package*.json ./frontend/ # Install dependencies RUN npm i RUN cd frontend && npm i # Copy source files COPY . . # Build frontend and backend RUN npm run build # Production stage FROM alpine:edge RUN apk update && apk add mpv npm yt-dlp pulseaudio pulseaudio-utils WORKDIR /app # Install only production dependencies COPY package*.json ./ RUN npm i --production # Copy built files COPY --from=builder /app/build ./build COPY --from=builder /app/frontend/dist ./dist/frontend EXPOSE 3000 CMD ["node", "build/server.js"]