mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-25 18:40:06 -04:00
Creating wrolpi-api-dev service to run api in debug mode.
This commit is contained in:
parent
1ce8f499d8
commit
7e9e815bf6
3 changed files with 30 additions and 1 deletions
|
|
@ -33,6 +33,15 @@ DEFAULT_CONFIG = {
|
|||
"use_https": False,
|
||||
"description": "Python API (Sanic)",
|
||||
},
|
||||
{
|
||||
"name": "wrolpi-api-dev",
|
||||
"systemd_name": "wrolpi-api-dev",
|
||||
"port": 8081,
|
||||
"viewable": True,
|
||||
"use_https": False,
|
||||
"description": "Python API (Development)",
|
||||
"show_only_when_running": True,
|
||||
},
|
||||
{
|
||||
"name": "wrolpi-app",
|
||||
"systemd_name": "wrolpi-app",
|
||||
|
|
|
|||
19
etc/raspberrypios/wrolpi-api-dev.service
Normal file
19
etc/raspberrypios/wrolpi-api-dev.service
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
[Unit]
|
||||
Description=WROLPi Python API (Development)
|
||||
Wants=postgresql.service
|
||||
PartOf=wrolpi.target
|
||||
Conflicts=wrolpi-api.service
|
||||
|
||||
[Service]
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/opt/wrolpi/venv/bin/python -m sanic main:api_app --host 0.0.0.0 --port 8081 -w 1 --reload --debug
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Group=wrolpi
|
||||
User=wrolpi
|
||||
WorkingDirectory=/opt/wrolpi/
|
||||
Restart=on-failure
|
||||
# Higher than the App so the API can start.
|
||||
Nice=4
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
|
@ -2,10 +2,11 @@
|
|||
Description=WROLPi Python API
|
||||
Wants=postgresql.service
|
||||
PartOf=wrolpi.target
|
||||
Conflicts=wrolpi-api-dev.service
|
||||
|
||||
[Service]
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
ExecStart=/opt/wrolpi/venv/bin/sanic main:api_app --host 0.0.0.0 --port 8081 -w 5
|
||||
ExecStart=/opt/wrolpi/venv/bin/python -O -m sanic main:api_app --host 0.0.0.0 --port 8081 -w 5
|
||||
ExecReload=/bin/kill -HUP $MAINPID
|
||||
Group=wrolpi
|
||||
User=wrolpi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue