Open nylocx opened 5 years ago
@nylocx , PRs are always welcome!
I'm not very good a JS, so my first try would be adding a statement like this to the start.sh script:
if [[ -v DB_PASSWORD_FILE ]] && [[ -e ${DB_PASSWORD_FILE} ]]; then
export DB_PASSWORD=$(cat ${DB_PASSWORD_FILE})
fi
But this will not work with the prepare command (node ./bin/konga.js $COMMAND --adapter $ADAPTER --uri $URI
) as I would have to do some magic with the $URI variable like:
URI=$(echo ${URI} | sed "s/<password>/${DB_PASSWORD}/")
And this again would require me to add something like <password>
to the uri in my docker compose file which is not very obvious unless documented. Any better ideas?
--- edit ---
I got an idea, we could do an
URI=$(eval echo ${URI})
with that we can write our docker compose command as:
command: "-c prepare -a postgres -u postgresql://konga:$$DB_PASSWORD@postgres:5432/konga"
But I'm not 100% sure if this will work.
@pantsel
@nylocx , PRs are always welcome!
Well, some useful PRs have arrived and remaining unmerged for long time, e.g. https://github.com/pantsel/konga/pull/586#issuecomment-654431890
Hi, I'm currently planning a setup of kong and konga in a docker swarm environment and I got pretty far for now. The related part of my compose file:
Currently I had to overwrite the entry point scripts of kong and konga to use docker secrets. The scripts are pretty simple and follows the schema:
But I would really like to have support for something like:
As supported in the postgres docker image. This would remove a lot of clutter from my compose file and I hope will benefit others that are trying to make their docker world a little bit safer. I'm pretty new to docker, but if you like I could try to create a PR for this feature.