Caddyfile для Django
Конфиг для обратного прокси Django с помощью Caddy⌗
example.com
route {
file_server /static/* {
root /public
}
}
route {
file_server /media/* {
root /public
}
}
reverse_proxy backend:8080
Docker compose проекта⌗
services:
caddy:
image: caddy
container_name: caddy_reverse_proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile:ro
- ./backend/static:/public/static:ro
- ./backend/media:/public/media
depends_on:
- backend
backend:
build: ./backend
container_name: django_backend
volumes:
- ./backend:/app
- ./django.log:/var/log/django.log
Читать другие посты