Includes: API (Express/TypeScript), Astro site, Python workers, document generators, FCC compliance tools, Canada CRTC formation, Ansible infrastructure, and deployment scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
40 lines
1.3 KiB
Django/Jinja
40 lines
1.3 KiB
Django/Jinja
[Unit]
|
|
Description=Performance West Docker Compose Stack
|
|
Documentation=https://performancewest.net
|
|
# Wait for Docker daemon AND full network (including DNS) before starting.
|
|
# network-online.target ensures the host has an IP + default route before
|
|
# Docker tries to resolve container hostnames or connect to external services.
|
|
After=docker.service network-online.target
|
|
Wants=network-online.target
|
|
Requires=docker.service
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
WorkingDirectory={{ project_dir }}
|
|
|
|
# Start: bring all services up detached; remove orphans from previous deploys
|
|
ExecStart=/usr/bin/docker compose up -d --remove-orphans
|
|
|
|
# Stop: graceful shutdown — 120 s drain gives ERPNext time to finish requests
|
|
ExecStop=/usr/bin/docker compose down --timeout 120
|
|
|
|
# Reload (systemctl reload performancewest): re-apply compose without full restart
|
|
ExecReload=/usr/bin/docker compose up -d --remove-orphans
|
|
|
|
# Give containers plenty of time to start (ERPNext + Frappe bench takes ~2 min)
|
|
TimeoutStartSec=300
|
|
TimeoutStopSec=180
|
|
|
|
# Restart on failure (e.g. Docker daemon crash), but not on clean stop
|
|
Restart=on-failure
|
|
RestartSec=30
|
|
|
|
User={{ deploy_user }}
|
|
Group={{ deploy_user }}
|
|
|
|
# Load .env so docker compose can expand all ${VAR} references
|
|
EnvironmentFile=-{{ project_dir }}/.env
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|