2025-10-08 13:54:19 +02:00
|
|
|
# Build stage
|
|
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
|
|
|
|
|
|
# Install pnpm
|
|
|
|
|
RUN npm install -g pnpm@9.0.0
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
# Copy package files
|
|
|
|
|
COPY package.json pnpm-lock.yaml* ./
|
|
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
# Copy source code
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
|
|
# Generate static site
|
2025-10-09 03:24:11 +02:00
|
|
|
RUN pnpm build
|
2025-10-08 13:54:19 +02:00
|
|
|
|
|
|
|
|
# Production stage
|
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
|
|
# Copy custom nginx config
|
|
|
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
|
|
|
|
|
|
# Copy built static site
|
2025-10-09 04:29:05 +02:00
|
|
|
COPY --from=builder /app/.output/public /usr/share/nginx/html/kompose
|
2025-10-08 13:54:19 +02:00
|
|
|
|
|
|
|
|
# Add healthcheck
|
2025-10-09 04:07:47 +02:00
|
|
|
# HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|
|
|
|
# CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
|
2025-10-08 13:54:19 +02:00
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|