[Unit]
Description=GNX-WEB Django Backend (Gunicorn)
After=network.target postgresql.service
Requires=postgresql.service

[Service]
Type=notify
User=gnx
Group=gnx
WorkingDirectory=/home/gnx/Desktop/GNX-WEB/backEnd
Environment="PATH=/home/gnx/Desktop/GNX-WEB/backEnd/venv/bin"
EnvironmentFile=/home/gnx/Desktop/GNX-WEB/backEnd/.env
ExecStart=/home/gnx/Desktop/GNX-WEB/backEnd/venv/bin/gunicorn \
    --bind 127.0.0.1:1086 \
    --workers 3 \
    --timeout 120 \
    --access-logfile /home/gnx/Desktop/GNX-WEB/backEnd/logs/gunicorn_access.log \
    --error-logfile /home/gnx/Desktop/GNX-WEB/backEnd/logs/gunicorn_error.log \
    --log-level info \
    gnx.wsgi:application
ExecReload=/bin/kill -s HUP $MAINPID
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target

