61 lines
1.6 KiB
YAML
61 lines
1.6 KiB
YAML
services:
|
|
michess:
|
|
build: .
|
|
image: michess:latest
|
|
container_name: michess
|
|
restart: unless-stopped
|
|
environment:
|
|
NODE_ENV: production
|
|
# PostgreSQL connection (uses 'db' service below)
|
|
PGHOST: db
|
|
PGPORT: 5432
|
|
PGDATABASE: ${POSTGRES_DB:-michess}
|
|
PGUSER: ${POSTGRES_USER:-michess}
|
|
PGPASSWORD: ${POSTGRES_PASSWORD:-changeme}
|
|
# App config
|
|
PORT: 3001
|
|
SESSION_SECRET: ${SESSION_SECRET:-change-this-secret-in-production}
|
|
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:3000}
|
|
# Admin setup: user with this email gets admin role on startup
|
|
ADMIN_EMAIL: ${ADMIN_EMAIL:-}
|
|
# Git update path (used by admin panel update button)
|
|
APP_DIR: /opt/michess
|
|
ports:
|
|
- "${MICHESS_PORT:-3000}:3000"
|
|
- "${MICHESS_API_PORT:-3001}:3001"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
volumes:
|
|
- app_pnpm:/opt/michess/.pnpm-store
|
|
networks:
|
|
- michess_net
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: michess_db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-michess}
|
|
POSTGRES_USER: ${POSTGRES_USER:-michess}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
- michess_net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-michess}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
app_pnpm:
|
|
driver: local
|
|
|
|
networks:
|
|
michess_net:
|
|
driver: bridge
|