docker / caddy conf

This commit is contained in:
Mayel de Borniol 2023-04-04 10:55:33 +12:00
parent 3e006867f7
commit 6757ed80c0
3 changed files with 25 additions and 2 deletions

View file

@ -25,9 +25,12 @@ services:
ports:
- "80:80"
- "443:443"
- "443:443/udp"
env_file:
- config/prod/.env
volumes:
- caddy_data:/data
- caddy_config:/config
- type: bind
source: ${PROXY_CADDYFILE_PATH}
target: /etc/caddy/Caddyfile
@ -52,3 +55,8 @@ services:
- "./data/search/prod:/data.ms"
env_file:
- config/prod/.env
volumes:
caddy_data:
external: true
caddy_config:

View file

@ -67,9 +67,12 @@ services:
ports:
- "80:80"
- "443:443"
- "443:443/udp"
env_file:
- config/dev/.env
volumes:
- caddy_data:/data
- caddy_config:/config
- type: bind
source: ${PROXY_CADDYFILE_PATH}
target: /etc/caddy/Caddyfile
@ -77,3 +80,8 @@ services:
- type: bind
source: ./data/uploads
target: /frontend/uploads
volumes:
caddy_data:
external: true
caddy_config:

View file

@ -26,6 +26,13 @@ route * {
# options
encode gzip
handle_errors
log
handle_errors {
@502 expression `{http.error.status_code} == 502`
handle @502 {
respond 503 {
body "Hello, unfortunately this instance seems to be down. Please try again in a few minutes!"
close
}
}
}