[Unit] Description=PBT Flask App (Gunicorn) After=network.target [Service] User=www-data WorkingDirectory=/opt/pbt # Secrets live in a root-owned file on the host, not in this tracked unit. # Copy pbt.env.example to /etc/pbt/pbt.env and fill in the real values. EnvironmentFile=/etc/pbt/pbt.env ExecStart=/opt/pbt/venv/bin/gunicorn --workers 2 --bind 127.0.0.1:8000 app:app Restart=always [Install] WantedBy=multi-user.target