Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ docker compose exec backend python manage.py createsuperuser

### Выполнить Собрать статику Django:
```
docker compose exec backend python manage.py collectstatic
sudo docker compose -f docker-compose.production.yml exec backend python manage.py collectstatic
sudo docker compose -f docker-compose.production.yml exec backend cp -r /app/collected_static/. /app/static/
```

Expand Down
2 changes: 1 addition & 1 deletion docker-compose.production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ services:
image: documents23/document-template-engine_gateway:latest
env_file: .env
ports:
- 8088:80
- 9000:80
volumes:
- static:/staticfiles/
- media:/app/media/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ services:
build: ./nginx/
env_file: .env
ports:
- 8088:80
- 9000:80
volumes:
- static:/staticfiles/
- media:/app/media/
54 changes: 12 additions & 42 deletions gateway/nginx.conf
Original file line number Diff line number Diff line change
@@ -1,52 +1,22 @@
server {
listen 80;

location /media/ {
proxy_set_header Host $http_host;
root /var/html/;
}

location /static/admin/ {
proxy_set_header Host $http_host;
root /var/html/;
}

location /static/rest_framework/ {
proxy_set_header Host $http_host;
root /var/html/;
}

location /static/drf-yasg/ {
proxy_set_header Host $http_host;
root /var/html/;
}

location /admin/ {
proxy_set_header Host $http_host;
proxy_pass http://backend:9000/admin/;
}
index index.html;

location /api/ {
proxy_set_header Host $http_host;
proxy_pass http://backend:9000/api/;
proxy_set_header Host $http_host;
proxy_pass http://backend:9000/api/;
}

location /swagger/ {
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_set_header Host $http_host;
proxy_pass http://backend:9000/swagger/;
location /admin/ {
proxy_set_header Host $http_host;
proxy_pass http://backend:9000/admin/;
}

location /redoc/ {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Protocol $scheme;
proxy_pass http://backend:9000/redoc/;
location /media/ {
proxy_set_header Host $http_host;
alias /app/media/;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;

alias /staticfiles/;
try_files $uri $uri/ /index.html;
}
}

}
52 changes: 0 additions & 52 deletions proxy-server/nginx.conf

This file was deleted.