version: '3.8' services: backend: build: context: ./backend dockerfile: Dockerfile.prod environment: - NODE_ENV=production - PORT=3001 env_file: - .env.production volumes: - backend_data:/app/data restart: unless-stopped networks: - internal healthcheck: test: ["CMD", "node", "-e", "require('http').get('http://localhost:3001/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"] interval: 30s timeout: 10s retries: 3 start_period: 40s frontend: build: context: ./frontend dockerfile: Dockerfile.prod depends_on: - backend restart: unless-stopped networks: - internal healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"] interval: 30s timeout: 10s retries: 3 nginx: image: nginx:alpine ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/ssl:/etc/nginx/ssl:ro - nginx_cache:/var/cache/nginx depends_on: - frontend - backend restart: unless-stopped networks: - internal volumes: backend_data: nginx_cache: networks: internal: driver: bridge