Closed
Description
Feature
Would it be possible to have a /docker-entrypoint-initdb.d/
equivalent for scripts that should be run before the database is externally accessible at every container startup?
Use case
My specific use case is to run migration scripts at container startup.
Implementation idea
The way I'm imagining it is extending docker-entrypoint.sh
so that:
- it checks if a folder like
/docker-entrypoint-startdb.d/
(noticestartdb
instead ofinitdb
) exists - starts the temp server if the database doesn't exist or if the database exists but the folder
/docker-entrypoint-startdb.d/
exists - runs every script inside the
/docker-entrypoint-startdb.d/
directory after the/docker-entrypoint-initdb.d/
scripts
Rationale
It's very difficult to extend this image with this functionality without writing a custom docker-entrypoint.sh
file (which would then not be updated when this image gets updated).