56 lines
1.1 KiB
Docker
56 lines
1.1 KiB
Docker
# Build stage
|
|
FROM node:24-alpine AS builder
|
|
|
|
# Accept build arguments for version info
|
|
ARG VERSION=""
|
|
ARG IS_RELEASE="false"
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies (production + dev for build)
|
|
RUN npm ci
|
|
|
|
# Copy source code and build dependencies
|
|
COPY src/ ./src/
|
|
COPY public/ ./public/
|
|
COPY scripts/ ./scripts/
|
|
COPY server.js ./server.js
|
|
COPY vite.config.js ./vite.config.js
|
|
COPY index.html ./index.html
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM node:24-alpine AS production
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install only production dependencies
|
|
RUN npm ci --only=production && npm cache clean --force
|
|
|
|
# Copy built application and server from build stage
|
|
COPY --from=builder /app/build ./build
|
|
COPY --from=builder /app/server.js ./server.js
|
|
|
|
# Copy entrypoint script
|
|
COPY entrypoint.sh ./entrypoint.sh
|
|
RUN chmod +x entrypoint.sh
|
|
|
|
# Expose port 3000
|
|
EXPOSE 3000
|
|
|
|
# Set LISTEN_ADDR to bind to all interfaces in container
|
|
ENV LISTEN_ADDR=0.0.0.0
|
|
ENV LISTEN_PORT=3000
|
|
|
|
# Start the integrated server
|
|
ENTRYPOINT ["./entrypoint.sh"] |