-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
60 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
server { | ||
client_max_body_size 4M; | ||
|
||
server_name surfcams.pecar.me; | ||
|
||
location / { | ||
proxy_set_header Host $http_host; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_redirect off; | ||
proxy_buffering off; | ||
proxy_pass http://surfcams; | ||
} | ||
|
||
} | ||
|
||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
|
||
upstream surfcams { | ||
server unix:///home/anze/projects/surfcams/gunicorn.sock; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -e | ||
pushd "$(dirname "$0")/.." | ||
uv run gunicorn surfcamsapi.asgi:application | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Surfcams | ||
After=nginx.service | ||
|
||
[Service] | ||
Type=simple | ||
Restart=always | ||
RestartSec=1 | ||
ExecStart=/bin/bash /home/anze/projects/surfcams/.deploy/run.sh | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -e | ||
pushd "$(dirname "$0")/.." | ||
git pull | ||
uv sync --frozen | ||
uv run python manage.py collectstatic --noinput | ||
uv run python manage.py migrate | ||
sudo kill -hup `cat gunicorn.pid` | ||
echo `date "+%Y-%m-%d %H:%M:%S.%3N"` ' Updated' >> update.log | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
bind = "unix:gunicorn.sock" | ||
workers = 1 | ||
threads = 4 | ||
proc_name = "surfcams" | ||
worker_class = "uvicorn.workers.UvicornWorker" | ||
pidfile = "gunicorn.pid" |