Without config.json:
1.) Docker container fails to start
2.) Logging does NOT show the reason the container failed to start.
Please add logic to:
1.) Provide logging showing that config.json doesn't exist.
2.) Create config.json with the defaults.
Change your current entrypoint in dockerfile to a CMD and add entrypoint.sh as your entrypoint. This will run entrypoint.sh and then the CMD when the container starts. It's a nice way to inject an init script of sorts.
entrypoint.sh
if [ ! -e /app/config.json ]
then
echo "config.json didn't exist, creating one!"
cp /app/defaultConfig.json /app/config.json
fi
exec "$@"
Without config.json:
1.) Docker container fails to start
2.) Logging does NOT show the reason the container failed to start.
Please add logic to:
1.) Provide logging showing that
config.jsondoesn't exist.2.) Create
config.jsonwith the defaults.Change your current entrypoint in dockerfile to a CMD and add entrypoint.sh as your entrypoint. This will run entrypoint.sh and then the CMD when the container starts. It's a nice way to inject an init script of sorts.
entrypoint.sh