config: enhance .env.example and refine Caddyfile formatting
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 8m44s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 7m27s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 1m49s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m56s

- Added new comments and examples in `.env.example` for clarity and proper configuration.
- Improved readability and structure of `Caddyfile` with better indentation, comments, and routing logic.

Signed-off-by: Stefan Mogeritsch <stefan.mo.co@gmail.com>
This commit is contained in:
2026-03-14 09:44:03 +01:00
parent 08e0edba4a
commit 6e7e22e588
3 changed files with 20 additions and 18 deletions
+13 -10
View File
@@ -1,40 +1,43 @@
{
# Global options
# TLS wird durch Pangolin/Traefik auf dem VPS terminiert hier kein HTTPS nötig
auto_https off
servers {
metrics
}
}
:4000 {
# Root directory
# Root-Verzeichnis für statische Assets
root * /usr/share/caddy
# Logging
# Logging (strukturiert, JSON)
log {
output stdout
format json
}
# Compression
# Komprimierung
encode gzip zstd
# Configuration Template
# Caddy-Template-Engine für config.json (liefert API_BASE_URL & KEYCLOAK_URL an den Browser)
templates {
mime application/json
}
# API Proxy (has priority)
# API-Proxy (höchste Priorität vor dem SPA-Fallback)
handle /api/* {
reverse_proxy api-gateway:8081
}
# Health Check
# Health-Check-Endpunkt (für Pangolin Health-Check konfigurieren: GET /health)
handle /health {
respond "healthy" 200
}
# Serve static files if they exist, otherwise serve index.html (SPA)
file_server
try_files {path} /index.html
# SPA-Fallback: existierende Dateien direkt ausliefern, sonst index.html
handle {
try_files {path} /index.html
file_server
}
}
+2 -8
View File
@@ -1,10 +1,4 @@
{
"apiBaseUrl": "{{env "
API_BASE_URL
" | default "
"}}",
"keycloakUrl": "{{env "
KEYCLOAK_URL
" | default "
"}}"
"apiBaseUrl": "{{env `API_BASE_URL`}}",
"keycloakUrl": "{{env `KEYCLOAK_URL`}}"
}