Switch to runtime envsubst for JSON-based Keycloak and API URLs, update Dockerfile and entrypoint to support config injection.
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 6m47s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 7m9s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 2m51s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m45s
Build and Publish Docker Images / build-and-push (., backend/infrastructure/gateway/Dockerfile, api-gateway, api-gateway) (push) Successful in 6m47s
Build and Publish Docker Images / build-and-push (., backend/services/ping/Dockerfile, ping-service, ping-service) (push) Successful in 7m9s
Build and Publish Docker Images / build-and-push (., config/docker/caddy/web-app/Dockerfile, web-app, web-app) (push) Successful in 2m51s
Build and Publish Docker Images / build-and-push (., config/docker/keycloak/Dockerfile, keycloak, keycloak) (push) Successful in 1m45s
This commit is contained in:
@@ -1,32 +1,32 @@
|
||||
{
|
||||
auto_https off
|
||||
metrics
|
||||
auto_https off
|
||||
metrics
|
||||
}
|
||||
|
||||
:4000 {
|
||||
root * /usr/share/caddy
|
||||
log {
|
||||
output stdout
|
||||
format json
|
||||
}
|
||||
root * /usr/share/caddy
|
||||
log {
|
||||
output stdout
|
||||
format json
|
||||
}
|
||||
|
||||
header {
|
||||
Cross-Origin-Embedder-Policy "require-corp"
|
||||
Cross-Origin-Opener-Policy "same-origin"
|
||||
}
|
||||
header {
|
||||
Cross-Origin-Embedder-Policy "require-corp"
|
||||
Cross-Origin-Opener-Policy "same-origin"
|
||||
}
|
||||
|
||||
encode gzip zstd
|
||||
encode gzip zstd
|
||||
|
||||
handle /api/* {
|
||||
reverse_proxy api-gateway:8081
|
||||
}
|
||||
handle /api/* {
|
||||
reverse_proxy api-gateway:8081
|
||||
}
|
||||
|
||||
handle /health {
|
||||
respond "healthy" 200
|
||||
}
|
||||
handle /health {
|
||||
respond "healthy" 200
|
||||
}
|
||||
|
||||
handle {
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
handle {
|
||||
try_files {path} /index.html
|
||||
file_server
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,8 +26,9 @@ LABEL service="web-app" \
|
||||
|
||||
# Copy Caddy Config & Entrypoint
|
||||
COPY config/docker/caddy/web-app/Caddyfile /etc/caddy/Caddyfile
|
||||
COPY config/docker/caddy/web-app/config.json /usr/share/caddy/config.json
|
||||
COPY config/docker/caddy/web-app/entrypoint.sh /entrypoint.sh
|
||||
# config.json als Template ablegen; der Entrypoint erzeugt daraus zur Laufzeit die finale config.json
|
||||
COPY config/docker/caddy/web-app/config.json /usr/share/caddy/config.json.tmpl
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
||||
# Copy Pre-built Static Assets from Host
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"apiBaseUrl": "{{.Env.API_BASE_URL}}",
|
||||
"keycloakUrl": "{{.Env.KEYCLOAK_URL}}"
|
||||
"apiBaseUrl": "${API_BASE_URL}",
|
||||
"keycloakUrl": "${KEYCLOAK_URL}"
|
||||
}
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Ersetze ${API_BASE_URL} und ${KEYCLOAK_URL} in index.html zur Container-Startzeit.
|
||||
# Caddy bekommt eine fertige, statische HTML-Datei — kein Template-Parsing mehr nötig.
|
||||
# Ersetze ${API_BASE_URL} und ${KEYCLOAK_URL} in index.html und config.json zur Container-Startzeit.
|
||||
# Caddy bekommt fertige, statische Dateien — kein Template-Parsing mehr nötig.
|
||||
envsubst '${API_BASE_URL} ${KEYCLOAK_URL}' \
|
||||
< /usr/share/caddy/index.html.tmpl \
|
||||
> /usr/share/caddy/index.html
|
||||
|
||||
envsubst '${API_BASE_URL} ${KEYCLOAK_URL}' \
|
||||
< /usr/share/caddy/config.json.tmpl \
|
||||
> /usr/share/caddy/config.json
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user