36 lines
903 B
Desktop File
36 lines
903 B
Desktop File
[Unit]
|
|
Description=Music Orchestrator API
|
|
# Start after network is up (needed for iTunes/YouTube calls)
|
|
After=network-online.target
|
|
Wants=network-online.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
# Runs as the user who installed the app (set by deploy.sh)
|
|
User=%i
|
|
WorkingDirectory=/opt/music-orchestrator/backend
|
|
|
|
# Use the virtualenv's uvicorn
|
|
ExecStart=/opt/music-orchestrator/backend/venv/bin/uvicorn \
|
|
main:app \
|
|
--host 127.0.0.1 \
|
|
--port 8000 \
|
|
--workers 1
|
|
|
|
# NOTE: workers=1 is intentional.
|
|
# Download job state is held in memory. Multiple workers would each
|
|
# have their own job store, breaking status polling.
|
|
|
|
Restart=on-failure
|
|
RestartSec=5s
|
|
|
|
# Give long-running downloads time to finish before force-killing
|
|
TimeoutStopSec=30s
|
|
|
|
# Logging goes to journald — view with: journalctl -u music-orchestrator -f
|
|
StandardOutput=journal
|
|
StandardError=journal
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|