Systemctl

This commit is contained in:
Thomas Forgione 2024-11-22 09:46:12 +01:00
parent 48c3e66595
commit 732e24fd63
2 changed files with 19 additions and 1 deletions

15
nenuscanner.service Normal file
View File

@ -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

View File

@ -1,8 +1,11 @@
#!/usr/bin/env python
import os
from . import app
from waitress import serve
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}')