serveur caddy
This commit is contained in:
@@ -26,36 +26,33 @@ services:
|
||||
condition: service_healthy
|
||||
command: >
|
||||
sh -c "python manage.py migrate --noinput &&
|
||||
gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 2
|
||||
--timeout 60 --access-logfile - --error-logfile -"
|
||||
gunicorn config.wsgi:application
|
||||
--bind 0.0.0.0:8000
|
||||
--workers 2
|
||||
--timeout 60
|
||||
--access-logfile -
|
||||
--error-logfile -"
|
||||
|
||||
# ── Nginx (reverse proxy + static files) ───────────────
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
# ── Caddy (reverse proxy + HTTPS automatique) ───────────
|
||||
caddy:
|
||||
image: caddy:2-alpine
|
||||
restart: always
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "443:443/udp"
|
||||
volumes:
|
||||
- ./nginx/nginx.dev-init.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ./Caddyfile.dev:/etc/caddy/Caddyfile:ro
|
||||
- static_volume_dev:/app/staticfiles:ro
|
||||
- media_volume_dev:/app/media:ro
|
||||
- certbot_www_dev:/var/www/certbot:ro
|
||||
- certbot_certs_dev:/etc/letsencrypt:ro
|
||||
- caddy_data_dev:/data
|
||||
- caddy_config_dev:/config
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
# ── Certbot (SSL Let's Encrypt) ─────────────────────────
|
||||
certbot:
|
||||
image: certbot/certbot
|
||||
volumes:
|
||||
- certbot_www_dev:/var/www/certbot
|
||||
- certbot_certs_dev:/etc/letsencrypt
|
||||
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
||||
|
||||
volumes:
|
||||
postgres_data_dev:
|
||||
static_volume_dev:
|
||||
media_volume_dev:
|
||||
certbot_www_dev:
|
||||
certbot_certs_dev:
|
||||
caddy_data_dev:
|
||||
caddy_config_dev:
|
||||
|
||||
Reference in New Issue
Block a user