Files
QueueCube/Dockerfile

36 lines
772 B
Docker
Raw Permalink Normal View History

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
2025-02-23 11:45:40 -08:00
COPY backend/package*.json ./backend/
2025-02-15 01:26:10 -08:00
COPY frontend/package*.json ./frontend/
# Copy source files
COPY . .
# Build frontend and backend
2025-02-23 19:32:32 -08:00
RUN npm install
2025-02-23 11:45:40 -08:00
RUN npm run build --workspaces
2025-02-15 01:26:10 -08:00
# Production stage
FROM --platform=$TARGETPLATFORM debian:testing-20250203
2025-02-15 01:26:10 -08:00
RUN apt-get update && apt-get install -y \
mpv npm yt-dlp pulseaudio pulseaudio-utils \
&& rm -rf /var/lib/apt/lists/*
2025-02-15 01:26:10 -08:00
WORKDIR /app
# Install only production dependencies
2025-02-23 11:45:40 -08:00
COPY backend/package*.json ./
RUN npm ci --production
2025-02-15 01:26:10 -08:00
# Copy built files
2025-02-23 11:45:40 -08:00
COPY --from=builder /app/backend/build ./build
2025-02-15 01:26:10 -08:00
COPY --from=builder /app/frontend/dist ./dist/frontend
EXPOSE 3000
CMD ["node", "build/server.js"]