docker-compose.prod.yml•1.95 kB
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
args:
- NODE_ENV=production
ports:
- "1337:1337"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres}@postgres:5432/docmcp
- PORT=1337
- LOG_LEVEL=info
- CORS_ORIGIN=${CORS_ORIGIN:-*}
depends_on:
postgres:
condition: service_healthy
volumes:
- app_logs:/app/logs
- app_data:/app/data
logging:
driver: "json-file"
options:
max-size: "100m"
max-file: "5"
healthcheck:
test: ["CMD", "/app/healthcheck.sh"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
# Production-specific optimizations
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.5'
memory: 512M
postgres:
image: ankane/pgvector:latest
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: docmcp
ports:
- "${POSTGRES_PORT:-5433}:5432" # Using 5433 to avoid conflict with existing PostgreSQL
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
logging:
driver: "json-file"
options:
max-size: "50m"
max-file: "3"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
restart: unless-stopped
# Production-specific optimizations
deploy:
resources:
limits:
cpus: '1'
memory: 1G
reservations:
cpus: '0.25'
memory: 256M
volumes:
postgres_data:
driver: local
app_logs:
driver: local
app_data:
driver: local