diff --git a/webapp/startGunicornService b/webapp/startGunicornService index 0dbe9de..bdaf233 100755 --- a/webapp/startGunicornService +++ b/webapp/startGunicornService @@ -2,6 +2,8 @@ set -euo pipefail -export PATH="/usr/bin/:/bin/:/srv/www/ftth-ipe-map/.poetry/bin" +POETRY_BIN=${REPO_DIR-/srv/www/ftth-ipe-map}/.poetry/bin + +export PATH="/usr/bin/:/bin/:$POETRY_BIN" poetry install poetry run gunicorn -b "localhost:${PORT}" --timeout 120 'main:app' diff --git a/webapp/test-ftth-ipe-map.service b/webapp/test-ftth-ipe-map.service new file mode 100644 index 0000000..c4c3660 --- /dev/null +++ b/webapp/test-ftth-ipe-map.service @@ -0,0 +1,31 @@ +[Unit] +After=network.target + +[Install] +WantedBy=default.target + +[Service] +Environment="PORT=6675" +Environment="CONFIG=/etc/test-ftth-ipe-map/conf.ini" +Environment="CONFIG=/etc/test-ftth-ipe-map/conf.ini" +Environment="REPO_DIR=/srv/www/test-ftth-ipe-map" +ConfigurationDirectory=test-ftth-ipe-map +WorkingDirectory=/srv/www/test-ftth-ipe-map/webapp/ +ExecStart=/srv/www/test-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 \ No newline at end of file