feat(api): listen on unix socket with gunicorn
This commit is contained in:
parent
ec45717ccf
commit
1cb03c35d2
4 changed files with 18 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
[Unit]
|
||||
Description=LibreTime API Service
|
||||
Requires=libretime-api.socket
|
||||
PartOf=libretime.target
|
||||
|
||||
[Service]
|
||||
|
@ -13,7 +14,7 @@ Environment=LIBRETIME_CONFIG_FILEPATH=@@CONFIG_FILEPATH@@
|
|||
ExecStart=/usr/bin/gunicorn \
|
||||
--workers 4 \
|
||||
--log-file - \
|
||||
--bind 127.0.0.1:8081 \
|
||||
--bind unix:/run/libretime-api.sock \
|
||||
libretime_api.wsgi
|
||||
ExecReload=/bin/kill -s HUP $MAINPID
|
||||
User=libretime
|
||||
|
|
11
api/install/systemd/libretime-api.socket
Normal file
11
api/install/systemd/libretime-api.socket
Normal file
|
@ -0,0 +1,11 @@
|
|||
[Unit]
|
||||
Description=LibreTime API Socket
|
||||
PartOf=libretime-api.service
|
||||
|
||||
[Socket]
|
||||
ListenStream=/run/libretime-api.sock
|
||||
SocketUser=@@DEFAULT_WEB_USER@@
|
||||
SocketMode=640
|
||||
|
||||
[Install]
|
||||
WantedBy=sockets.target
|
Loading…
Add table
Add a link
Reference in a new issue