Skip to content

Commit

Permalink
Update server config
Browse files Browse the repository at this point in the history
  • Loading branch information
manti-by committed Mar 19, 2024
1 parent bc73171 commit 7f6ed5a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 97 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ static/
content/
manti_by/settings/local.py
manti_by/settings/prod.py
database.sql
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,4 @@ RUN pip install --trusted-host pypi.org --no-cache-dir --upgrade pip && \
USER manti
WORKDIR /srv/app/src/
CMD python manage.py runserver
<<<<<<< Updated upstream
=======

>>>>>>> Stashed changes
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ psql:
dump:
docker exec -it manti-by-postgres pg_dump -U manti_by -d manti_by > database.sql

restore:
docker cp database.sql manti-by-postgres:/tmp/database.sql
docker exec -it manti-by-postgres psql -U manti_by manti_by -f /tmp/database.sql

migrate:
docker exec -it manti-by-django python manage.py migrate

Expand All @@ -28,4 +32,4 @@ test:
pytest

update-requirements:
pcu requirements.txt -u
pcu requirements.txt -u
85 changes: 0 additions & 85 deletions config/nginx-static.conf

This file was deleted.

10 changes: 5 additions & 5 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ server {
charset utf-8;

location / {
alias /mnt/nostromo/www/manti/static/;
alias /mnt/data/www/manti/static/;

if ($request_filename ~ "^.*/(.+\.(jpe?g|png|gif|svg|json|webp|js|css|eot|ttf|woff|woff2))$") {
expires max;
Expand Down Expand Up @@ -62,7 +62,7 @@ server {
charset utf-8;

location / {
alias /mnt/nostromo/www/manti/content/;
alias /mnt/data/www/manti/content/;

if ($request_filename ~ "^.*/(.+\.(mp3|ogg|flac))$") {
set $fname $1;
Expand Down Expand Up @@ -101,8 +101,8 @@ server {

client_max_body_size 500M;

access_log /mnt/nostromo/www/manti/log/nginx_access.log;
error_log /mnt/nostromo/www/manti/log/nginx_error.log;
access_log /mnt/data/www/manti/log/nginx_access.log;
error_log /mnt/data/www/manti/log/nginx_error.log;

error_page 400 401 403 404 /400.html;
error_page 500 502 503 504 /500.html;
Expand All @@ -118,7 +118,7 @@ server {
}

location /(manifest.json|favicon.ico|robots.txt) {
root /mnt/nostromo/www/manti/static/;
root /mnt/data/www/manti/static/;

expires 30d;
access_log off;
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ services:
- DJANGO_SETTINGS_MODULE=manti_by.settings.prod
volumes:
- /home/manti/www/manti/:/srv/app/src/
- /mnt/nostromo/www/manti/static/:/var/lib/app/static/
- /mnt/nostromo/www/manti/content/:/var/lib/app/content/
- /mnt/nostromo/www/manti/log/:/var/log/app/
- /mnt/data/www/manti/static/:/var/lib/app/static/
- /mnt/data/www/manti/content/:/var/lib/app/content/
- /mnt/data/www/manti/log/:/var/log/app/
command: |
gunicorn manti_by.wsgi:application --bind 0.0.0.0:8080 --workers 2 --log-file /var/log/app/wsgi.log

0 comments on commit 7f6ed5a

Please sign in to comment.