Files
whalehunting/Dockerfile
Thomas Richter 0064773eaa Add Docker-based production deployment
- Multi-stage Dockerfile with Node builder and nginx server
- Nginx configuration with gzip, security headers, and caching
- Docker Compose setup with health checks
- Updated README with deployment instructions

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-16 23:34:05 +01:00

38 lines
739 B
Docker

# Multi-stage build for production deployment
# Stage 1: Build the application
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Stage 2: Serve with nginx
FROM nginx:alpine
# Copy built files from builder stage
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy 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 --quiet --tries=1 --spider http://localhost/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]