kiwix: fiddle

This commit is contained in:
Starbeamrainbowlabs 2022-11-05 23:50:33 +00:00
parent 510d8d0cd2
commit bddaa05363
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 20 additions and 5 deletions

View file

@ -24,3 +24,5 @@ WORKDIR /app
USER 10600:10600
ENTRYPOINT [ "/srv/run.sh" ]
CMD [ "serve" ]

View file

@ -1,13 +1,26 @@
#!/usr/bin/env bash
echo ">>> Environment:"
echo "[wrapper] NOMAD_PORT_KIWIX=$NOMAD_PORT_KIWIX"
echo "[wrapper] Args: $*"
mode="$1";
shift;
echo ">>> Checking environment"
echo ">>> Environment:";
echo "[wrapper] NOMAD_PORT_KIWIX=$NOMAD_PORT_KIWIX";
echo "[wrapper] Mode: ${mode}";
echo "[wrapper] Args: $*";
echo ">>> Checking environment";
if [[ -z "${NOMAD_PORT_KIWIX}" ]]; then
echo "Error: The environment variable NOMAD_PORT_KIWIX is not set. It must be set to the port number to listen on." >&2;
fi
echo ">>> Starting kiwix";
/app/kiwix-serve --library --port "${NOMAD_PORT_KIWIX}" /srv/data;
case "${mode}" in
serve )
echo ">>> kiwix-serve --library --port ${NOMAD_PORT_KIWIX} /srv/data";
/app/kiwix-serve --library --port "${NOMAD_PORT_KIWIX}" /srv/data;
;;
* )
echo ">>> kiwix-serve $*";
/app/kiwix-serve "$@";
;;
esac