Код: Выделить всё
services:
web:
container_name: web
build:
context: .
dockerfile: Dockerfile
command: bash -c "python manage.py makemigrations && python manage.py migrate && python
manage.py collectstatic --no-input && gunicorn mysite.wsgi:application
--bind 0.0.0.0:8000"
volumes:
- .:/app
- static:/app/static
env_file:
- .env
ports:
- "8000:8000"
nginx:
build: ./nginx
volumes:
- static:/app/static
ports:
- "80:80"
depends_on:
- web
Код: Выделить всё
upstream django {
server web:8000;
}
server {
listen 80;
location / {
proxy_pass http://django;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /static/ {
alias /app/static/;
}
# Increase client max body size to 50M
client_max_body_size 50M;
Подробнее здесь: https://stackoverflow.com/questions/790 ... ner-timeou