From 8cf14124d5b64a0151b560aefcb48579af6710e730ab52937c634c2696bc3a58 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 31 Aug 2026 12:51:17 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?systemd=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- systemd/admin-portal.service | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 systemd/admin-portal.service diff --git a/systemd/admin-portal.service b/systemd/admin-portal.service new file mode 100644 index 0000000..f2f8225 --- /dev/null +++ b/systemd/admin-portal.service @@ -0,0 +1,29 @@ +[Unit] +Description=Admin Portal (Django/Gunicorn) +After=network.target postgresql.service redis-server.service +Wants=postgresql.service redis-server.service + +[Service] +Type=simple +User=adminportal +Group=adminportal +WorkingDirectory=/opt/admin-portal/django_app +EnvironmentFile=/etc/admin-portal/admin-portal.env +ExecStart=/opt/admin-portal/venv/bin/gunicorn \ + config.wsgi:application \ + --bind 127.0.0.1:8000 \ + --workers 3 \ + --timeout 30 \ + --access-logfile - \ + --error-logfile - +Restart=on-failure +RestartSec=3 + +# Базовое ужесточение — при необходимости ослабить под конкретный дистрибутив +NoNewPrivileges=true +PrivateTmp=true +ProtectSystem=full +ReadWritePaths=/opt/admin-portal/django_app/staticfiles + +[Install] +WantedBy=multi-user.target