cmziuk/Dockerfile
Cameron Redmore 212351ef2a
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m59s
Testing.
2025-08-08 19:47:36 +01:00

34 lines
742 B
Docker

# Build stage
FROM oven/bun:latest as builder
WORKDIR /app
# Copy package files
COPY package.json bun.lock* ./
# Install all dependencies (including devDependencies for building)
RUN bun install --frozen-lockfile
# Copy source code and configuration files
COPY . .
# Build the frontend with Vite and compile the server to executable
RUN bun run build
# Minimal production stage using distroless debian
FROM gcr.io/distroless/cc-debian12
WORKDIR /app
# Copy the built assets
COPY --from=builder /app/dist/* /app/dist/
COPY --from=builder /app/dist/assets /app/dist/assets
# Expose the port
EXPOSE 3000
# Set environment to production
ENV NODE_ENV=production
# Start the application using the compiled executable
CMD ["/app/server"]