Загрузить файлы в «systemd»
This commit is contained in:
1 parent
2b1132c097
commit
8cf14124d5
1 file changed
+29
@@ -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
|
||||||
Reference in new issue
Block a user