ops: deploy webapp on Gaia
Add systemd service + start script and deploy all that on Gaia.
This commit is contained in:
parent
38c67ee588
commit
6308ae9cea
3 changed files with 37 additions and 1 deletions
29
webapp/ftth-ipe-map.service
Normal file
29
webapp/ftth-ipe-map.service
Normal file
|
@ -0,0 +1,29 @@
|
|||
[Unit]
|
||||
After=network.target
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
|
||||
[Service]
|
||||
Environment="PORT=6665"
|
||||
# /etc/ftth-ipe-map/conf.ini
|
||||
ConfigurationDirectory=ftth-ipe-map
|
||||
WorkingDirectory=/srv/www/ftth-ipe-map/webapp/
|
||||
ExecStart=/srv/www/ftth-ipe-map/webapp/startGunicornService
|
||||
User=ftth-ipe-map
|
||||
Group=ftth-ipe-map
|
||||
Restart=on-failure
|
||||
RestartSec=30
|
||||
|
||||
# Sandboxing
|
||||
#ProtectSystem=strict
|
||||
#ProtectHome=tmpfs
|
||||
PrivateTmp=true
|
||||
PrivateDevices=true
|
||||
ProtectClock=true
|
||||
ProtectKernelTunables=true
|
||||
ProtectKernelModules=true
|
||||
ProtectKernelLogs=true
|
||||
ProtectControlGroups=true
|
||||
RestrictAddressFamilies=AF_INET
|
||||
RestrictRealtime=true
|
|
@ -9,7 +9,7 @@ class Config(TypedDict):
|
|||
dbPath: str
|
||||
|
||||
def parseConfig() -> Config:
|
||||
cfg_path = os.environ.get("CONFIG", "/etc/ipe-ftth-elig/conf.ini")
|
||||
cfg_path = os.environ.get("CONFIG", "/etc/ftth-ipe-map/conf.ini")
|
||||
cfg = configparser.ConfigParser()
|
||||
with open(cfg_path, "r") as f:
|
||||
cfg.read_file(f)
|
||||
|
|
7
webapp/startGunicornService
Executable file
7
webapp/startGunicornService
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
export PATH="/usr/bin/:/bin/:/srv/www/Axione-FTTH-Test/.poetry/bin/"
|
||||
poetry install
|
||||
poetry run gunicorn -b "localhost:${PORT}" --timeout 120 'main:app'
|
Loading…
Reference in a new issue