docker-library / postgres

Docker Official Image packaging for Postgres
http://www.postgresql.org
MIT License
2.16k stars 1.13k forks source link

the docker-entrypoint.sh file is not having the capability of running setup files from i.e /always-initdb.d/* #1039

Closed vadimbo closed 1 year ago

vadimbo commented 1 year ago

There is no easy way to have a setup file that I would need to run every time when the container starts.

An example would be to apply automatically the latest schema changes/updates on the existing DB.

Currently, the possibility is to set setup scripts in /docker-entrypoint-initdb.d/* that would be executed only in the case there is need to setup the DB (first time).

There is no possibility to execute setup scripts every time the container starts. i.e. to have the scripts placed in /always-initdb.d/* executed every time the container starts.

wglambert commented 1 year ago

See https://github.com/docker-library/postgres/issues/173, https://github.com/docker-library/postgres/issues/821, https://github.com/docker-library/postgres/issues/191, https://github.com/docker-library/postgres/issues/929 (one of which I think this is really a duplicate).