-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adaptations to have a local dev environment on port 8002
- Loading branch information
Showing
4 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM node:14-alpine as builder | ||
|
||
RUN apk --no-cache add yarn python3 | ||
WORKDIR /app | ||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
COPY package.json yarn.lock /app/ | ||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
#!/bin/sh | ||
|
||
JS_PATH=/usr/share/nginx/html/environ.json | ||
echo "dump ZIMFARM_* environ variables to $JS_PATH" | ||
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))' > $JS_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 | ||
|
||
cat $JS_PATH | ||
cat $ENVIRON_PATH | ||
echo "-----" | ||
|
||
exec "$@" |