Kong 2.0.5 compose file with wait-for script in command and KONG_PG_PASSWORD_FILE

My compose file has wait-for script to wait for a postgres database port be accessible before kong (2.0.5) starts:
command: /bin/wait-for postgres:5432-- kong start
The database has a password saved in a secret, which is referenced in the compose file:
KONG_PG_PASSWORD_FILE: /var/run/secrets/postgres_password

When starting the stack, the docker-entrypoint.sh from the kong container doesn’t set the password from the secret because the argument in command isn’t kong:
if [[ "1" == "kong" ]]; then PREFIX={KONG_PREFIX:=/usr/local/kong}
file_env KONG_PG_PASSWORD
file_env KONG_PG_USER
file_env KONG_PG_DATABASE

Is there a way to set the command for the kong container in the compose file to wait for postgres port to be accessible before “kong start” and use KONG_PG_PASSWORD_FILE without having to edit docker-entrypoint.sh or anything else in the container image?


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ