feat(deploy): add an example systemd service
Provide a dedicated-user service with automatic restart and restricted file permissions.
This commit is contained in:
1 parent
6eb2694470
commit
06c7509647
1 file changed
+21
@@ -0,0 +1,21 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=RexiMemo Open Source Edition
|
||||||
|
After=network-online.target
|
||||||
|
Wants=network-online.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
User=reximemo-ose
|
||||||
|
Group=reximemo-ose
|
||||||
|
WorkingDirectory=/opt/reximemo-ose
|
||||||
|
ExecStart=/opt/reximemo-ose/.venv/bin/python -u /opt/reximemo-ose/server.py
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=5
|
||||||
|
Environment=PYTHONUNBUFFERED=1
|
||||||
|
Environment=PYTHONDONTWRITEBYTECODE=1
|
||||||
|
NoNewPrivileges=true
|
||||||
|
PrivateTmp=true
|
||||||
|
UMask=0027
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in new issue
Block a user
