- Remove version: '3.8' from docker-compose.prod.yml - Convert healthcheck test to JSON array form - Quote port mappings in prod - Remove stray blank line after header in docker-compose.yml
62 lines
1.3 KiB
YAML
62 lines
1.3 KiB
YAML
# Docker Compose configuration for EDH Stats Tracker
|
|
services:
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
target: production
|
|
ports:
|
|
- '3002:3000'
|
|
environment:
|
|
- NODE_ENV=development
|
|
- DATABASE_PATH=/app/database/data/edh-stats.db
|
|
- JWT_SECRET=dev-jwt-secret-key-change-in-production
|
|
- CORS_ORIGIN=http://localhost
|
|
- LOG_LEVEL=info
|
|
- ALLOW_REGISTRATION=false
|
|
volumes:
|
|
- sqlite_data:/app/database/data
|
|
- ./backend/src:/app/src
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test:
|
|
[
|
|
'CMD',
|
|
'wget',
|
|
'--no-verbose',
|
|
'--tries=1',
|
|
'--spider',
|
|
'http://localhost:3000/api/health'
|
|
]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
networks:
|
|
- edh-stats-network
|
|
|
|
frontend:
|
|
image: nginx:alpine
|
|
ports:
|
|
- '8081:80'
|
|
volumes:
|
|
- ./frontend/nginx.conf:/etc/nginx/nginx.conf:ro
|
|
- ./frontend/public:/usr/share/nginx/html:ro
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
networks:
|
|
- edh-stats-network
|
|
|
|
volumes:
|
|
sqlite_data:
|
|
driver: local
|
|
driver_opts:
|
|
type: none
|
|
o: bind
|
|
device: ${PWD}/database/data
|
|
|
|
networks:
|
|
edh-stats-network:
|
|
driver: bridge
|