Skip to content

Commit

Permalink
Add deployment-specific files
Browse files Browse the repository at this point in the history
  • Loading branch information
wil93 committed Nov 3, 2024
1 parent 37b69d4 commit 559458a
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ db.sqlite3
__pycache__/
old_app/
.env*
/static
62 changes: 62 additions & 0 deletions nginx/itacpc
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
server {
server_name teams24.itacpc.it;

location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/itacpc/teams;
}

location / {
include proxy_params;
proxy_pass http://unix:/run/gunicorn.sock;
}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/teams24.itacpc.it-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/teams24.itacpc.it-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



}
server {
if ($host = teams.itacpc.it) {
return 301 https://itacpc.it/;
}
server_name teams.itacpc.it;

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/teams24.itacpc.it-0001/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/teams24.itacpc.it-0001/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = teams24.itacpc.it) {
return 301 https://$host$request_uri;
} # managed by Certbot


listen 80;
server_name teams24.itacpc.it;
return 404; # managed by Certbot


}

server {
if ($host = teams.itacpc.it) {
return 301 https://$host$request_uri;
} # managed by Certbot



listen 80;
server_name teams.itacpc.it;
return 404; # managed by Certbot


}
17 changes: 17 additions & 0 deletions systemd/gunicorn.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target

[Service]
User=itacpc
Group=www-data
WorkingDirectory=/home/itacpc/teams
ExecStart=/home/itacpc/.local/share/virtualenvs/teams-_GRcvIg0/bin/gunicorn \
--access-logfile - \
--workers 3 \
--bind unix:/run/gunicorn.sock \
itacpc.wsgi:application

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions systemd/gunicorn.socket
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Unit]
Description=gunicorn socket

[Socket]
ListenStream=/run/gunicorn.sock

[Install]
WantedBy=sockets.target

0 comments on commit 559458a

Please sign in to comment.