From 592c2b5701c7a5f1c7a83bd21c803c8886e07e52 Mon Sep 17 00:00:00 2001 From: benoit74 Date: Wed, 27 Sep 2023 08:19:10 +0200 Subject: [PATCH] ENVIRON_PATH is a mandatory environment variable + small fixes --- dev/docker-compose.yml | 1 - dev/frontend-ui-dev/Dockerfile | 1 - dispatcher/frontend-ui/Dockerfile | 1 + dispatcher/frontend-ui/entrypoint.sh | 4 ---- 4 files changed, 1 insertion(+), 6 deletions(-) diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 625456738..9fd6ad8c5 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -45,7 +45,6 @@ services: build: dockerfile: ../../dev/frontend-ui-dev/Dockerfile context: ../dispatcher/frontend-ui - # build: ../dispatcher/frontend-ui container_name: zf_frontend-ui-dev volumes: - ../dispatcher/frontend-ui/src:/app/src diff --git a/dev/frontend-ui-dev/Dockerfile b/dev/frontend-ui-dev/Dockerfile index 7e4d52267..2ff42aec2 100644 --- a/dev/frontend-ui-dev/Dockerfile +++ b/dev/frontend-ui-dev/Dockerfile @@ -8,7 +8,6 @@ RUN yarn install && yarn cache clean COPY *.js /app/ COPY public /app/public COPY src /app/src -#CMD ["sleep", "infinity"] ENV ENVIRON_PATH /app/public/environ.json ENTRYPOINT [ "entrypoint.sh" ] CMD ["yarn", "serve", "--host", "0.0.0.0", "--port", "80"] \ No newline at end of file diff --git a/dispatcher/frontend-ui/Dockerfile b/dispatcher/frontend-ui/Dockerfile index 26f6692d8..19e1d6c31 100644 --- a/dispatcher/frontend-ui/Dockerfile +++ b/dispatcher/frontend-ui/Dockerfile @@ -20,6 +20,7 @@ COPY nginx-default.conf /etc/nginx/conf.d/default.conf COPY entrypoint.sh /usr/local/bin/entrypoint.sh ENV ZIMFARM_WEBAPI https://api.farm.openzim.org/v1 +ENV ENVIRON_PATH /usr/share/nginx/html/environ.json EXPOSE 80 ENTRYPOINT ["entrypoint.sh"] diff --git a/dispatcher/frontend-ui/entrypoint.sh b/dispatcher/frontend-ui/entrypoint.sh index 98da0f0fd..281a85447 100755 --- a/dispatcher/frontend-ui/entrypoint.sh +++ b/dispatcher/frontend-ui/entrypoint.sh @@ -1,9 +1,5 @@ #!/bin/sh -if [ -z "${ENVIRON_PATH}" ] -then - ENVIRON_PATH=/usr/share/nginx/html/environ.json -fi echo "dump ZIMFARM_* environ variables to $ENVIRON_PATH" python3 -c 'import os; import json; print(json.dumps({k: v for k, v in os.environ.items() if k.startswith("ZIMFARM_")}, indent=4))' > $ENVIRON_PATH