Skip to content

Commit f47c95a

Browse files
committed
BE: Store nginx and systemd files in server/config
1 parent e35c0f4 commit f47c95a

2 files changed

Lines changed: 35 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Link to /etc/systemd/system/wut.sh-gunicorn.service
2+
# After update, run: `sudo systemctl daemon-reload && sudo service wut.sh-gunicorn reload`
3+
4+
[Unit]
5+
Description=gunicorn daemon for wut.sh
6+
Requires=wut.sh-gunicorn.socket
7+
After=network.target
8+
9+
[Service]
10+
Type=notify
11+
# the specific user that our service will run as
12+
User=webadmin
13+
Group=adm
14+
# another option for an even more restricted service is
15+
# DynamicUser=yes
16+
# see http://0pointer.net/blog/dynamic-users-with-systemd.html
17+
#RuntimeDirectory=wut.sh-gunicorn
18+
#WorkingDirectory=/var/www/wut.sh
19+
ExecStart=/var/www/wut.sh/venv/bin/gunicorn \
20+
--chdir /var/www/wut.sh/server \
21+
-b unix:/run/wut.sh-gunicorn.sock \
22+
-w 3 \
23+
#-e DJANGO_SETTINGS_MODULE="config.settings_production" \
24+
-e DJANGO_SETTINGS_MODULE="config.settings" \
25+
--capture-output \
26+
--log-file /var/log/gunicorn/wut.sh.log \
27+
config.wsgi
28+
ExecReload=/bin/kill -s HUP $MAINPID
29+
KillMode=mixed
30+
TimeoutStopSec=5
31+
PrivateTmp=true
32+
33+
[Install]
34+
WantedBy=multi-user.target

nginx.conf renamed to server/config/nginx.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Link to /etc/nginx/sites-enabled/wut.sh
12
#* Reference: https://docs.gunicorn.org/en/latest/deploy.html
23

34
# Expires map for file TTL

0 commit comments

Comments
 (0)