2025-02-15 01:26:10 -08:00
|
|
|
# Build stage
|
2025-02-16 00:58:35 -08:00
|
|
|
FROM --platform=$TARGETPLATFORM node:20-slim AS builder
|
2025-02-15 01:26:10 -08:00
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy package files
|
|
|
|
|
COPY package*.json ./
|
|
|
|
|
COPY frontend/package*.json ./frontend/
|
|
|
|
|
|
|
|
|
|
# Install dependencies
|
2025-02-15 14:58:34 -08:00
|
|
|
RUN npm ci
|
|
|
|
|
RUN cd frontend && npm ci
|
2025-02-15 01:26:10 -08:00
|
|
|
|
|
|
|
|
# Copy source files
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Build frontend and backend
|
|
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
|
|
# Production stage
|
2025-02-16 00:58:35 -08:00
|
|
|
FROM --platform=$TARGETPLATFORM alpine:edge
|
2025-02-15 01:26:10 -08:00
|
|
|
|
|
|
|
|
RUN apk update && apk add mpv npm yt-dlp pulseaudio pulseaudio-utils
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Install only production dependencies
|
|
|
|
|
COPY package*.json ./
|
2025-02-15 14:58:34 -08:00
|
|
|
RUN npm ci --production
|
2025-02-15 01:26:10 -08:00
|
|
|
|
|
|
|
|
# Copy built files
|
|
|
|
|
COPY --from=builder /app/build ./build
|
|
|
|
|
COPY --from=builder /app/frontend/dist ./dist/frontend
|
|
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
CMD ["node", "build/server.js"]
|