cmziuk/Dockerfile
Cameron Redmore adff8cce0f
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m44s
Debugging.
2025-08-08 20:18:32 +01:00

33 lines
721 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 debian:12
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"]