env template and Dockerfile
This commit is contained in:
parent
6bb73f0bc5
commit
5fa74043bc
@ -1,9 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
cat <<EOF > /usr/share/nginx/html/env.js
|
||||
window.ENV = {
|
||||
API_BASE: "${API_BASE:-http://localhost:8000}"
|
||||
};
|
||||
EOF
|
||||
# מחליף את הטמפלייט במשתנה האמיתי שהוזן כ־ENV
|
||||
envsubst < /usr/share/nginx/html/env.js.template > /usr/share/nginx/html/env.js
|
||||
|
||||
# מריץ את nginx
|
||||
exec nginx -g "daemon off;"
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
window.ENV = {
|
||||
API_BASE: "${API_BASE}"
|
||||
API_BASE: "__API_BASE__"
|
||||
};
|
||||
|
||||
@ -19,4 +19,4 @@ spec:
|
||||
- containerPort: {{ .Values.frontend.port }}
|
||||
env:
|
||||
- name: API_BASE
|
||||
value: "https://{{ .Values.backend.ingress.host }}"
|
||||
value: {{ .Values.frontend.env.API_BASE | quote }}
|
||||
Loading…
x
Reference in New Issue
Block a user