mirror of
https://github.com/optim-enterprises-bv/OptimCloud-gw-ui.git
synced 2025-10-30 01:42:19 +00:00
[WIFI-2853] Add: configration generation in runtime via env variables
This commit is contained in:
@@ -6,9 +6,10 @@ RUN npm install
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN echo '{"DEFAULT_GATEWAY_URL": "https://ucentral.dpaas.arilia.com:16001","ALLOW_GATEWAY_CHANGE": true}' > public/config.json \
|
||||
&& npm run build
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.20.1-alpine AS runtime
|
||||
|
||||
COPY --from=build /build/ /usr/share/nginx/html/
|
||||
|
||||
COPY --from=build docker-entrypoint.d/40-generate-config.sh /docker-entrypoint.d/40-generate-config.sh
|
||||
|
||||
6
docker-entrypoint.d/40-generate-config.sh
Executable file
6
docker-entrypoint.d/40-generate-config.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/ash
|
||||
# Check if variables are set
|
||||
export DEFAULT_GATEWAY_URL="${DEFAULT_GATEWAY_URL:-https://ucentral.dpaas.arilia.com:16001}"
|
||||
export ALLOW_GATEWAY_CHANGE="${ALLOW_GATEWAY_CHANGE:-false}"
|
||||
|
||||
echo '{"DEFAULT_GATEWAY_URL": "'$DEFAULT_GATEWAY_URL'","ALLOW_GATEWAY_CHANGE": '$ALLOW_GATEWAY_CHANGE'}' > /usr/share/nginx/html/config.json
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"DEFAULT_GATEWAY_URL": "https://ucentral.dpaas.arilia.com:16001",
|
||||
"ALLOW_GATEWAY_CHANGE": false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user