From 0690968771611feb58fbd12b401c7cbbc68223d2 Mon Sep 17 00:00:00 2001 From: Artur Galyamov Date: Thu, 29 Dec 2022 11:56:03 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20co?= =?UTF-8?q?nf-=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B4=D0=BB=D1=8F=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=BA=D0=B0=D1=82=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B0=20production=20#27?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/gunicorn_start | 23 +++++++++++++++++++++++ conf/nginx/crossposting.conf | 11 +++++++++++ conf/supervisor/conf.d/crossposting_django.conf | 10 ++++++++++ 3 files changed, 44 insertions(+) create mode 100644 conf/gunicorn_start create mode 100644 conf/nginx/crossposting.conf create mode 100644 conf/supervisor/conf.d/crossposting_django.conf diff --git a/conf/gunicorn_start b/conf/gunicorn_start new file mode 100644 index 0000000..978ca0c --- /dev/null +++ b/conf/gunicorn_start @@ -0,0 +1,23 @@ +#!/bin/bash + +NAME="crossposting" +DIR=/home/redex2000/crossposting/backend/current +USER=redex2000 +GROUP=redex2000 +WORKERS=3 +BIND='0.0.0.0:8888' +DJANGO_SETTINGS_MODULE=crossposting_backend.settings +VENV_DIR=/home/redex2000/crossposting/backend/shared/crossposting_env/bin +LOG_LEVEL=error +cd $VENV_DIR +source ./activate +export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE +export PYTHONPATH=$DIR:$PYTHONPATH +exec ./gunicorn crossposting_backend.wsgi:application \ + --name $NAME \ + --workers $WORKERS \ + --user=$USER \ + --group=$GROUP \ + --bind=$BIND \ + --log-level=$LOG_LEVEL \ + --log-file=- diff --git a/conf/nginx/crossposting.conf b/conf/nginx/crossposting.conf new file mode 100644 index 0000000..47dce58 --- /dev/null +++ b/conf/nginx/crossposting.conf @@ -0,0 +1,11 @@ +server { + listen 8989; + server_name zakonvremeni.ru; + access_log /var/log/nginx/crossposting/access.log; + error_log /var/log/nginx/crossposting/error.log error; + root /home/redex2000/crossposting/backend/current; + + location / { + proxy_pass http://localhost:8888; + } +} \ No newline at end of file diff --git a/conf/supervisor/conf.d/crossposting_django.conf b/conf/supervisor/conf.d/crossposting_django.conf new file mode 100644 index 0000000..581b4a0 --- /dev/null +++ b/conf/supervisor/conf.d/crossposting_django.conf @@ -0,0 +1,10 @@ +[program:crossposting_django] +command=/home/redex2000/crossposting/backend/shared/crossposting_env/bin/gunicorn_start +directory=/home/redex2000/crossposting/backend/current +user=redex2000 +autorestart=true +redirect_stderr=true +stdout_logfile = /var/log/supervisor/crossposting/out.log +stderr_logfile = /var/log/supervisor/crossposting/err.log +startsecs=10 +startretries=5 \ No newline at end of file