Files
wh-leader 259fef1f95
CI/CD Pipeline / Build & Deploy (push) Failing after 49s
fix: install all dependencies including devDependencies for build
2026-05-11 12:04:09 +02:00

37 lines
740 B
Docker

# Multi-stage build for Astro static site
# Stage 1: Build
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install ALL dependencies (build needs devDependencies)
RUN npm ci
# Copy source
COPY . .
# Build static site
RUN npm run build
# Stage 2: Production - nginx
FROM nginx:alpine
# Copy built site to nginx html directory
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config (if needed for SPA routing)
COPY nginx.conf /etc/nginx/nginx.conf
# Expose port
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
CMD ["nginx", "-g", "daemon off;"]