73 lines
1.6 KiB
YAML
73 lines
1.6 KiB
YAML
# BMAD Web - Production Overrides
|
|
# Use with: docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
|
|
|
|
version: '3.8'
|
|
|
|
services:
|
|
postgres:
|
|
restart: always
|
|
environment:
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD is required}
|
|
# Don't expose port in production
|
|
ports: []
|
|
|
|
redis:
|
|
restart: always
|
|
command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-}
|
|
ports: []
|
|
|
|
api:
|
|
restart: always
|
|
environment:
|
|
NODE_ENV: production
|
|
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET is required}
|
|
DATABASE_URL: ${DATABASE_URL:?DATABASE_URL is required}
|
|
REDIS_URL: ${REDIS_URL:?REDIS_URL is required}
|
|
# Remove volume mounts in production
|
|
volumes: []
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1'
|
|
memory: 1G
|
|
reservations:
|
|
cpus: '0.5'
|
|
memory: 512M
|
|
|
|
web:
|
|
restart: always
|
|
environment:
|
|
NODE_ENV: production
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '0.5'
|
|
memory: 512M
|
|
reservations:
|
|
cpus: '0.25'
|
|
memory: 256M
|
|
|
|
# Nginx Reverse Proxy for production
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: bmad-nginx
|
|
restart: always
|
|
depends_on:
|
|
- web
|
|
- api
|
|
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
|
|
healthcheck:
|
|
test: ["CMD", "nginx", "-t"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
volumes:
|
|
nginx_cache:
|