added systemd unit
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Raspberry Pi Signal Light API
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
|
||||||
|
User=pi
|
||||||
|
Group=pi
|
||||||
|
|
||||||
|
WorkingDirectory=/opt/signal-light-api
|
||||||
|
|
||||||
|
Environment="PATH=/opt/signal-light-api/bin"
|
||||||
|
|
||||||
|
ExecStart=/opt/signal-light-api/bin/uvicorn main:app \
|
||||||
|
--host 0.0.0.0 \
|
||||||
|
--port 8000
|
||||||
|
|
||||||
|
Restart=always
|
||||||
|
RestartSec=5
|
||||||
|
|
||||||
|
# Send stdout/stderr to the journal
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user