All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m32s
35 lines
790 B
Docker
35 lines
790 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/server /app/server
|
|
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"]
|