1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 13:04:19 +00:00

Create web-nest systemd service

This commit is contained in:
Stefano Pigozzi 2021-05-12 04:49:25 +02:00
parent 85ae08b6ce
commit e0a18bde3a
Signed by untrusted user who does not match committer: steffo
GPG key ID: 6965406171929D01
4 changed files with 48 additions and 15 deletions

View file

@ -1,7 +1,6 @@
from flask import Flask from flask import Flask
from flask_cors import CORS as FlaskCORS from flask_cors import CORS as FlaskCORS
from flask_jwt_extended import JWTManager as FlaskJWTManager from flask_jwt_extended import JWTManager as FlaskJWTManager
from flask_sqlalchemy import SQLAlchemy as FlaskSQLAlchemy
from werkzeug.middleware.proxy_fix import ProxyFix as MiddlewareProxyFix from werkzeug.middleware.proxy_fix import ProxyFix as MiddlewareProxyFix
from . import database, routes, gestione, swagger from . import database, routes, gestione, swagger
@ -107,5 +106,4 @@ app.register_error_handler(
# --- REVERSE PROXY --- # --- REVERSE PROXY ---
if not __debug__: rp_app = MiddlewareProxyFix(app=app, x_for=1, x_proto=0, x_host=1, x_port=0, x_prefix=0)
app = MiddlewareProxyFix(app=app, x_for=1, x_proto=0, x_host=1, x_port=0, x_prefix=0)

View file

@ -222,6 +222,20 @@ python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*"
[package.extras] [package.extras]
docs = ["sphinx"] docs = ["sphinx"]
[[package]]
name = "gunicorn"
version = "20.1.0"
description = "WSGI HTTP Server for UNIX"
category = "main"
optional = false
python-versions = ">=3.5"
[package.extras]
eventlet = ["eventlet (>=0.24.1)"]
gevent = ["gevent (>=1.4.0)"]
setproctitle = ["setproctitle"]
tornado = ["tornado (>=0.2)"]
[[package]] [[package]]
name = "idna" name = "idna"
version = "2.10" version = "2.10"
@ -798,7 +812,7 @@ watchdog = ["watchdog"]
[metadata] [metadata]
lock-version = "1.1" lock-version = "1.1"
python-versions = "^3.8.5" python-versions = "^3.8.5"
content-hash = "9c4f3517887f1d12fc4196119a7d3398fa61a5214809fcfd1a324d87ca8baeaf" content-hash = "1ac47344a839aae5a929d7ce9914f62c76c1a591bc88dabb819fe15814f40031"
[metadata.files] [metadata.files]
alabaster = [ alabaster = [
@ -963,6 +977,10 @@ greenlet = [
{ file = "greenlet-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:aa4230234d02e6f32f189fd40b59d5a968fe77e80f59c9c933384fe8ba535535" }, { file = "greenlet-1.1.0-cp39-cp39-win_amd64.whl", hash = "sha256:aa4230234d02e6f32f189fd40b59d5a968fe77e80f59c9c933384fe8ba535535" },
{ file = "greenlet-1.1.0.tar.gz", hash = "sha256:c87df8ae3f01ffb4483c796fe1b15232ce2b219f0b18126948616224d3f658ee" }, { file = "greenlet-1.1.0.tar.gz", hash = "sha256:c87df8ae3f01ffb4483c796fe1b15232ce2b219f0b18126948616224d3f658ee" },
] ]
gunicorn = [
{ file = "gunicorn-20.1.0-py3-none-any.whl", hash = "sha256:9dcc4547dbb1cb284accfb15ab5667a0e5d1881cc443e0677b4882a4067a807e" },
{ file = "gunicorn-20.1.0.tar.gz", hash = "sha256:e0a968b5ba15f8a328fdfd7ab1fcb5af4470c28aaf7e55df02a99bc13138e6e8" },
]
idna = [ idna = [
{ file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" }, { file = "idna-2.10-py2.py3-none-any.whl", hash = "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" },
{ file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6" }, { file = "idna-2.10.tar.gz", hash = "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6" },

View file

@ -28,6 +28,7 @@ openapi-spec-validator = "^0.3.0"
flask-swagger-ui = "^3.36.0" flask-swagger-ui = "^3.36.0"
tweepy = "^3.10.0" tweepy = "^3.10.0"
nltk = "^3.6.2" nltk = "^3.6.2"
gunicorn = "^20.1.0"
[tool.poetry.dev-dependencies] [tool.poetry.dev-dependencies]
pytest = "^6.2.3" pytest = "^6.2.3"

View file

@ -0,0 +1,16 @@
[Unit]
Description=N.E.S.T. Backend Webserver
Wants=network-online.target postgresql.service
After=network-online.target nss-lookup.target postgresql.service
[Service]
Type=exec
User=nest
Group=nest
# Cambia questa riga alla tua directory di installazione
WorkingDirectory=/srv/nest
# Cambia questa riga al tuo venv
ExecStart=/srv/nest/venv/bin/gunicorn -b 127.0.0.1:5000 --env "FLASK_CONFIG=/srv/nest/config.py" nest_backend.app:rp_app
[Install]
WantedBy=multi-user.target