- Add auto-deploy.sh script with full CI/CD pipeline - Add quick-deploy.sh for fast development deployments - Add Git post-receive hook for automatic deployment on push - Add comprehensive deployment documentation - Add npm scripts for easy deployment management - Include health checks, logging, and cleanup - Support for automatic rollback on failures
70 lines
1.5 KiB
YAML
70 lines
1.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
portfolio:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: portfolio-app
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
|
|
- GHOST_API_URL=${GHOST_API_URL}
|
|
- GHOST_API_KEY=${GHOST_API_KEY}
|
|
- MY_EMAIL=${MY_EMAIL}
|
|
- MY_INFO_EMAIL=${MY_INFO_EMAIL}
|
|
- MY_PASSWORD=${MY_PASSWORD}
|
|
- MY_INFO_PASSWORD=${MY_INFO_PASSWORD}
|
|
volumes:
|
|
- portfolio_data:/app/.next/cache
|
|
networks:
|
|
- portfolio-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512M
|
|
cpus: '0.5'
|
|
reservations:
|
|
memory: 256M
|
|
cpus: '0.25'
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: portfolio-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./ssl:/etc/nginx/ssl:ro
|
|
- nginx_cache:/var/cache/nginx
|
|
depends_on:
|
|
- portfolio
|
|
networks:
|
|
- portfolio-network
|
|
healthcheck:
|
|
test: ["CMD", "nginx", "-t"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
portfolio_data:
|
|
driver: local
|
|
nginx_cache:
|
|
driver: local
|
|
|
|
networks:
|
|
portfolio-network:
|
|
driver: bridge
|