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