deploy user has no sudo for systemctl. Instead: - Use 'docker compose up -d --force-recreate' to recreate the web container without needing systemctl - Change Restart=always so systemd re-attaches after the container is recreated - Replace 'sudo journalctl' with 'docker compose logs' in error path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
27 lines
580 B
Desktop File
27 lines
580 B
Desktop File
[Unit]
|
|
Description=No Hype AI (Docker Compose)
|
|
Requires=docker.service
|
|
After=docker.service network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
User=deploy
|
|
Group=www-data
|
|
WorkingDirectory=/srv/sum/nohype
|
|
|
|
ExecStartPre=docker compose -f docker-compose.prod.yml pull --ignore-pull-failures
|
|
ExecStart=docker compose -f docker-compose.prod.yml up --build
|
|
ExecStop=docker compose -f docker-compose.prod.yml down
|
|
|
|
Restart=always
|
|
RestartSec=10
|
|
TimeoutStartSec=300
|
|
TimeoutStopSec=30
|
|
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
SyslogIdentifier=sum-nohype
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|