Description
Over in postgis/docker-postgis#35, I had a user ask about adding their own script to /docker-entrypoint-initdb.d
via docker-compose
without overwriting the script I use for initializing PostGIS. My suggestion was to bind-mount individual scripts, but it dawned on me that it might be nice to be able to add scripts to subdirectories of /docker-entrypoint-initdb.d
and have them sourced or executed according to the existing logic.
The main drawback I see of making this change is that it's possible that existing users of the postgres
image may already have files in subdirectories of /docker-entrypoint-initdb.d
that they don't want to have executed directly by the postgres
entrypoint. Another minor but solvable issue is maintaining the execution order of the scripts, which I believe I documented when this functionality was originally added:
These initialization files will be executed in sorted name order as defined by the current locale, which defaults to
en_US.utf8