Files
fa-agent/compose.yaml
T
2026-09-26 01:12:10 +08:00

79 lines
1.9 KiB
YAML

name: traceiq
x-app: &app
build:
context: .
args:
VITE_AG_GRID_LICENSE_KEY: ${VITE_AG_GRID_LICENSE_KEY:-}
image: traceiq:local
env_file: .env
volumes:
- uploads:/app/var/uploads
restart: unless-stopped
init: true
read_only: true
tmpfs:
- /tmp:size=1g,mode=1777
cap_drop: [ALL]
security_opt: [no-new-privileges:true]
services:
db:
image: postgres:17-bookworm
environment:
POSTGRES_DB: traceiq
POSTGRES_USER: traceiq
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}
volumes:
- postgres:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: [CMD-SHELL, 'pg_isready -U traceiq -d traceiq']
interval: 5s
retries: 20
migrate:
<<: *app
command: [python, manage.py, migrate, --noinput]
restart: "no"
depends_on:
db:
condition: service_healthy
web:
<<: *app
depends_on:
migrate:
condition: service_completed_successfully
healthcheck:
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen(urllib.request.Request('http://localhost:8000/api/health', headers={'X-Forwarded-Proto':'https'}), timeout=5)"]
interval: 30s
timeout: 10s
retries: 3
worker:
<<: *app
command: [python, manage.py, import_worker]
depends_on:
migrate:
condition: service_completed_successfully
cleanup:
<<: *app
command: [python, manage.py, cleanup_formula_exports, --loop]
depends_on:
migrate:
condition: service_completed_successfully
proxy:
image: caddy:2.10-alpine
environment:
DOMAIN: ${DOMAIN:?Set DOMAIN}
ports: ['80:80', '443:443']
volumes:
- ./deploy/Caddyfile:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
restart: unless-stopped
depends_on:
web:
condition: service_healthy
volumes:
postgres:
uploads:
caddy_data:
caddy_config: