30 lines
831 B
Desktop File
30 lines
831 B
Desktop File
[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
|