thermograph/infra/deploy/thermograph.service
Emi Griffith ae1d9bb534 Subtree-merge thermograph-infra (origin/main) into infra/
git-subtree-dir: infra
git-subtree-mainline: d6df04eab2
git-subtree-split: 99b4b3f78d
2026-07-22 22:01:11 -07:00

22 lines
869 B
Desktop File

[Unit]
Description=Thermograph docker-compose stack (app + PostgreSQL)
# Docker must be up, and the network online, before compose can pull/interpolate.
After=docker.service network-online.target
Wants=network-online.target
Requires=docker.service
[Service]
# A thin manager for the compose stack: `up -d` starts it and returns, the unit
# stays "active" (RemainAfterExit) so `systemctl restart thermograph` re-runs it.
# Compose owns container ordering and restarts via depends_on + restart policies.
Type=oneshot
RemainAfterExit=yes
WorkingDirectory=/opt/thermograph
# POSTGRES_PASSWORD (and the other secrets) are needed at `docker compose`
# interpolation time. The leading `-` makes a missing file non-fatal.
EnvironmentFile=-/etc/thermograph.env
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.target