When I run docker-compose up all working good. I've got problem with static file after reboot. All containers starts, but on static files request we got 404.
Yet another time, problems begins after server reboot. When I say:
docker-compose up
All working perfectly.
docker-compose.yml
web:
restart: always
build: .
command: /usr/local/bin/gunicorn ems3.wsgi:application -w 2 -b :8031
volumes:
- .:/code
ports:
- "8031:8031"
links:
- db
nginx:
restart: always
build: ./nginx/
ports:
- "8002:8002" # 443
- "8001:8001" # 80
volumes:
- /www/static
volumes_from:
- web
links:
- web:web
db:
restart: always
image: postgres
ports:
- "5555:5555"
environment:
- POSTGRES_PASSWORD=mysecr3333
- POSTGRES_USER=postgres
nginx_config
server {
listen 8002 ssl default;
location /static {
alias /code/static;
}
location / {
proxy_pass http://web:8031;
proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header Host $host:$server_port;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}