From affabb064a1eb92f122433f9cef89feaabeb0d4c Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sat, 16 Dec 2023 17:15:48 +0100 Subject: [PATCH] Zelrmvlf --- conf/gunicorn.service | 16 ---------------- conf/gunicorn_config.py | 22 +++++++++++----------- conf/local.py.j2 | 2 +- conf/systemd.service | 2 +- 4 files changed, 13 insertions(+), 29 deletions(-) delete mode 100644 conf/gunicorn.service diff --git a/conf/gunicorn.service b/conf/gunicorn.service deleted file mode 100644 index 87ba5fa..0000000 --- a/conf/gunicorn.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=YNH_APP_INSTANCE_NAME gunicorn daemon -After=network.target - -[Service] -PIDFile=/run/gunicorn/YNH_APP_INSTANCE_NAME-pid -User=YNH_APP_INSTANCE_NAME -Group=www-data -WorkingDirectory=/opt/YNH_APP_INSTANCE_NAME -ExecStart=__YNH_PYTHON_PATH__/gunicorn -c /opt/YNH_APP_INSTANCE_NAME/gunicorn_config.py YNH_APP_INSTANCE_NAME.wsgi -ExecReload=/bin/kill -s HUP $MAINPID -ExecStop=/bin/kill -s TERM $MAINPID -PrivateTmp=true - -[Install] -WantedBy=multi-user.target diff --git a/conf/gunicorn_config.py b/conf/gunicorn_config.py index d1c2a5d..bb99fbc 100644 --- a/conf/gunicorn_config.py +++ b/conf/gunicorn_config.py @@ -1,11 +1,11 @@ -command = '__YNH_PYTHON_PATH__/gunicorn' -pythonpath = '/opt/__APP__' -workers = 4 -user = '__APP__' -bind = 'unix:/opt/__APP__/sock' -pid = '/run/gunicorn/__APP__-pid' -errorlog = '/var/log/__APP__/error.log' -accesslog = '/var/log/__APP__/access.log' -access_log_format = '%({X-Real-IP}i)s %({X-Forwarded-For}i)s %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' -loglevel = 'warning' -capture_output = True +command = '__INSTALL_DIR/venv/bin/gunicorn' +pythonpath = '__INSTALL_DIR__' +workers = 4 +user = '__APP__' +bind = 'unix:__INSTALL_DIR__/sock' +pid = '/run/gunicorn/__APP__-pid' +errorlog = '/var/log/__APP__/error.log' +accesslog = '/var/log/__APP__/access.log' +access_log_format = '%({X-Real-IP}i)s %({X-Forwarded-For}i)s %(h)s %(l)s %(u)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"' +loglevel = 'warning' +capture_output = True diff --git a/conf/local.py.j2 b/conf/local.py.j2 index 692eacc..da936d0 100644 --- a/conf/local.py.j2 +++ b/conf/local.py.j2 @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals import os -from settings_base import * +from .settings_base import * DEBUG = TEMPLATE_DEBUG = False diff --git a/conf/systemd.service b/conf/systemd.service index 1531ef2..9179d0e 100644 --- a/conf/systemd.service +++ b/conf/systemd.service @@ -7,7 +7,7 @@ PIDFile=/run/gunicorn/__APP__-pid User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/ -ExecStart=__YNH_PYTHON_PATH__/gunicorn -c __INSTALL_DIR__/gunicorn_config.py __APP__.wsgi +ExecStart=__INSTALL_DIR__/venv/bin/gunicorn -c __INSTALL_DIR__/gunicorn_config.py __APP__.wsgi ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true