45 lines
847 B
YAML
45 lines
847 B
YAML
version: '3.8'
|
|
|
|
services:
|
|
email-service:
|
|
build: .
|
|
ports:
|
|
- "3001:3001"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3001
|
|
env_file:
|
|
- .env
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
volumes:
|
|
- ./logs:/app/logs
|
|
networks:
|
|
- email-network
|
|
|
|
# Optional: Add a reverse proxy
|
|
nginx:
|
|
image: nginx:alpine
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./ssl:/etc/nginx/ssl:ro
|
|
depends_on:
|
|
- email-service
|
|
restart: unless-stopped
|
|
networks:
|
|
- email-network
|
|
|
|
networks:
|
|
email-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
logs: |