add Caddy as reverse proxy

This commit is contained in:
Michi 2025-05-02 14:23:11 +02:00
parent bec06107dc
commit afce0130e1
2 changed files with 34 additions and 0 deletions

25
caddy/Caddyfile Normal file
View file

@ -0,0 +1,25 @@
<DOMAIN> {
handle_path /api/* {
rewrite /api/* /{http.request.uri.path.4}
reverse_proxy webservice-inp21b:8080
}
handle / {
reverse_proxy frontend:5173
}
tls internal
}
http://<DOMAIN> {
handle_path /api/* {
rewrite /api/* /{http.request.uri.path.4}
reverse_proxy webservice-inp21b:8080
}
handle / {
reverse_proxy frontend:5173
}
}

View file

@ -21,6 +21,7 @@ services:
- 8080:8080 - 8080:8080
environment: environment:
- DB_CONNECTION_STRING=postgresql://bbzw-horizon:<PW>@db/bbzw-horizon - DB_CONNECTION_STRING=postgresql://bbzw-horizon:<PW>@db/bbzw-horizon
- CRYPTO_SUBSTITION_KEY=""
frontend: frontend:
build: build:
@ -42,3 +43,11 @@ services:
restart: unless-stopped restart: unless-stopped
user: 0:0 user: 0:0
caddy:
image: caddy:2.10
ports:
- "80:80"
- "443:443"
volumes:
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
restart: unless-stopped