Systemctl
This commit is contained in:
parent
48c3e66595
commit
732e24fd63
|
|
@ -0,0 +1,15 @@
|
||||||
|
[Unit]
|
||||||
|
Description=NenuScanner
|
||||||
|
After=network.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
RestartSec=2s
|
||||||
|
Type=simple
|
||||||
|
User=pi
|
||||||
|
Group=pi
|
||||||
|
ExecStart=nenuscanner
|
||||||
|
Restart=always
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
from . import app
|
from . import app
|
||||||
from waitress import serve
|
from waitress import serve
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
serve(app, listen='*:8000')
|
port = os.environ.get('FLASK_RUN_PORT', 80)
|
||||||
|
print(f'Starting server on port {port}')
|
||||||
|
serve(app, listen=f'*:{port}')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue