Skip to content

Commit

Permalink
ENVIRON_PATH is a mandatory environment variable + small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Sep 27, 2023
1 parent 84f4a04 commit 592c2b5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion dev/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion dev/frontend-ui-dev/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
1 change: 1 addition & 0 deletions dispatcher/frontend-ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
4 changes: 0 additions & 4 deletions dispatcher/frontend-ui/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 592c2b5

Please sign in to comment.