Хочу понять, как настроить Gateaway, чтоб он получал картинки из media:/recipes (Это volumes)
На данный момент настройки такие:
nginx.conf
location /media/ {
proxy_set_header Host $http_host;
alias /media/;
client_max_body_size 20M;
}
docker.compose
volumes:
foodgram_data_production:
static:
media:
services:
db:
image: postgres:13.10
env_file: .env
volumes:
- foodgram_data_production:/var/lib/postgresql/data
backend:
image: ridleq/foodgram_backend
env_file: .env
volumes:
- static:/backend_static
- media:/app/media
frontend:
image: ridleq/foodgram_frontend
env_file: .env
command: cp -r /app/build/. /frontend_static/
volumes:
- static:/frontend_static
gateway:
image: ridleq/foodgram_infra
env_file: .env
volumes:
- static:/staticfiles/
- media:/recipes
ports:
- 8000:80
Сейчас при открытии сайта картинки не грузятся, выдает ошибку:project-react-gateway-1 | 2023/12/13 19:37:21 [error] 40#40: *24 open() "/staticfiles/media/recipes/photo_RJHdeEe.png" failed (2: No such file or directory)