Files
accounting-backend/docker-compose.yml
AmirAli Angha 2a1918b47c Prepare accounting backend for production behind nginx and CDN proxy.
Add reverse-proxy settings, stricter CORS origin parsing, and production env defaults for acc.zoneco.org and the admin panel.
2026-07-08 02:11:32 +03:30

54 lines
1.8 KiB
YAML

services:
accounting-backend:
build:
context: .
dockerfile: Dockerfile
container_name: funzone_accounting_backend
ports:
- "127.0.0.1:8010:8010"
environment:
SECRET_KEY: ${SECRET_KEY:-your-super-secret-key-change-in-production}
DEBUG: ${DEBUG:-False}
ALLOWED_HOSTS: ${ALLOWED_HOSTS:-localhost,127.0.0.1,accounting-backend,acc.zoneco.org}
CORS_ALLOW_ALL_ORIGINS: ${CORS_ALLOW_ALL_ORIGINS:-True}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-http://localhost:3006,http://localhost:5176,http://127.0.0.1:3006,http://127.0.0.1:5176,https://admin.zoneco.org}
SQLITE_PATH: /data/db.sqlite3
DATABASE_URL: ${DATABASE_URL:-}
DB_HOST: accounting-db
POSTGRES_USER: ${POSTGRES_USER:-accounting_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-accounting_password}
POSTGRES_DB: ${POSTGRES_DB:-accounting_db}
volumes:
- accounting_sqlite:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8010/health"]
interval: 30s
timeout: 10s
start_period: 40s
retries: 3
accounting-db:
image: postgres:16-alpine
container_name: funzone_accounting_postgres
profiles:
- postgres
environment:
POSTGRES_DB: ${POSTGRES_DB:-accounting_db}
POSTGRES_USER: ${POSTGRES_USER:-accounting_user}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-accounting_password}
volumes:
- accounting_postgres:/var/lib/postgresql/data
ports:
- "127.0.0.1:5434:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-accounting_user} -d ${POSTGRES_DB:-accounting_db}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
accounting_sqlite:
accounting_postgres: