Configure Quartz for production

This commit is contained in:
vorpax
2026-01-05 22:41:39 +01:00
parent f3622751a1
commit 4bab7d0d86
19 changed files with 778 additions and 9 deletions

35
Dockerfile.prod Normal file
View File

@@ -0,0 +1,35 @@
# Stage 1: Build Quartz site
FROM node:22-slim AS builder
WORKDIR /usr/src/app
# Copy package files
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm ci
# Copy source code
COPY . .
# Build Quartz (this generates the static site in /public)
RUN npx quartz build
# Stage 2: Serve with Nginx
FROM nginx:alpine
# Copy the built static files from builder stage
COPY --from=builder /usr/src/app/public /usr/share/nginx/html
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]