From f4b89f2300c3cfec7c53b2c5a5eebdb38e2479ce Mon Sep 17 00:00:00 2001 From: VladislavCR Date: Sat, 24 Feb 2024 14:32:23 +0300 Subject: [PATCH] nginx static --- infra/docker-compose-prod.yaml | 7 +++++-- infra/nginx/nginx.conf | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/infra/docker-compose-prod.yaml b/infra/docker-compose-prod.yaml index f3f7a97..8a4a03a 100644 --- a/infra/docker-compose-prod.yaml +++ b/infra/docker-compose-prod.yaml @@ -19,7 +19,8 @@ services: ports: - "8000:8000" volumes: - - static_volume:/backend_static + - static_volume:/backend_static/ + - media_value:/backend_media/ depends_on: - db @@ -28,7 +29,9 @@ services: ports: - "80:80" volumes: - - static_volume:/static + - ./nginx/default.conf:/etc/nginx/conf.d/default.conf + - static_volume:/var/html/static/ + - media_value:/var/html/media/ - /etc/letsencrypt:/etc/letsencrypt depends_on: - backend diff --git a/infra/nginx/nginx.conf b/infra/nginx/nginx.conf index 212e656..aa6ebf6 100644 --- a/infra/nginx/nginx.conf +++ b/infra/nginx/nginx.conf @@ -11,6 +11,9 @@ server { proxy_set_header Host $http_host; proxy_pass http://backend:8000/admin/; } + location /media/ { + root /var/html/; + } location / { alias /staticfiles/; index index.html;