Files
QueueCube/Dockerfile

43 lines
924 B
Docker
Raw 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 ffmpeg \
&& 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 ./
COPY package-lock.json ./
RUN rm -rf node_modules/ # need to do a clean build
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
# Copy entrypoint script
COPY entrypoint.sh ./
RUN chmod +x entrypoint.sh
2025-02-15 01:26:10 -08:00
EXPOSE 3000
CMD ["./entrypoint.sh"]