fix: write the runtime config in the web image too

The Kubernetes deployment runs the split go-guess-web image, which is a plain
nginx serving static files and never ran an entrypoint. The theme service origin
is therefore never written into runtime-config.js there, so the page would always
read the empty default and theming would be silently inert in the cluster while
working in local runs. The combined root image already did this; the split one
now does too.

The script lives beside the frontend Dockerfile because that image's build
context is ./frontend, which cannot see docker/.

The chart passes THEME_BASE_URL to the web container rather than the API: it is
read by the browser, not by the service. It stays absent when unset, so a
deployment with no theme service renders exactly as before.
This commit is contained in:
Daniel Noulet 2026-10-05 22:55:46 +02:00
parent 0a78c98cc6
commit 570345e4b5
4 changed files with 41 additions and 1 deletions

View file

@ -39,6 +39,14 @@ spec:
imagePullPolicy: {{ .Values.web.image.pullPolicy }}
securityContext:
{{- toYaml .Values.web.securityContext | nindent 12 }}
env:
{{- with .Values.web.themeBaseUrl }}
# Read by the browser, not the API, so it goes to the web container:
# the entrypoint writes it into runtime-config.js on start. Empty keeps
# the application on its own styling.
- name: THEME_BASE_URL
value: {{ . | quote }}
{{- end }}
ports:
- name: http
containerPort: 80

View file

@ -78,8 +78,13 @@ web:
replicaCount: 2
image:
repository: batty1039.startdedicated.net:5000/go-guess-web
tag: "0.0.1"
tag: "0.1.0"
pullPolicy: IfNotPresent
# Origin of the go-bananas runtime supplying the shared styling contract, for
# example https://bananas-dev.urpi.be. Empty keeps this application's own
# styles. The theme service must also allow this application's origin, or the
# browser refuses to load the controls from it.
themeBaseUrl: ""
service:
type: ClusterIP
port: 80