[Unit] Description=tubbymemes meme service Documentation=https://tubbymemes.xyz After=network.target [Service] PermissionsStartOnly = true PIDFile = /opt/tubbymemes/data/gunicorn/tubbymemes.pid User = tubbymemes Group = tubbymemes WorkingDirectory = /opt/tubbymemes ExecStartPre = /bin/mkdir -p /opt/tubbymemes/data/gunicorn ExecStartPre = /bin/chown -R tubbymemes:tubbymemes /opt/tubbymemes/data/gunicorn Environment = FLASK_APP=tubbymemes/app.py Environment = FLASK_SECRETS=config.py Environment = FLASK_ENV=production Environment = FLASK_DEBUG=0 ExecStart = /opt/tubbymemes/.venv/bin/gunicorn --bind 127.0.0.1:4000 "tubbymemes.app:app" --log-file /opt/tubbymemes/data/gunicorn/gunicorn.log --pid /opt/tubbymemes/data/gunicorn/tubbymemes.pid --reload ExecReload = /bin/kill -s HUP /opt/tubbymemes/data/gunicorn/tubbymemes.pid ExecStop = /bin/kill -s TERM /opt/tubbymemes/data/gunicorn/tubbymemes.pid ExecStopPost = /bin/rm -rf /opt/tubbymemes/data/gunicorn/tubbymemes.pid PrivateTmp = true [Install] WantedBy=default.target