# /etc/systemd/system/brand-manual.service # # Keeps the app running persistently, restarts it if it crashes, and # starts it automatically on server reboot. # # Install: # sudo cp brand-manual.service /etc/systemd/system/ # sudo systemctl daemon-reload # sudo systemctl enable --now brand-manual # # Logs: sudo journalctl -u brand-manual -f # Restart after a deploy: sudo systemctl restart brand-manual [Unit] Description=Brand Manual Generator (FastAPI) After=network.target [Service] Type=simple User=www-data Group=www-data WorkingDirectory=/opt/brand-manual-server ExecStart=/opt/brand-manual-server/venv/bin/uvicorn app:app --host 127.0.0.1 --port 8000 --workers 1 Restart=on-failure RestartSec=5 # Hardening -- limits what this process can touch on the box. NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ReadWritePaths=/opt/brand-manual-server/jobs [Install] WantedBy=multi-user.target