You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
then it will automatically run those sql files for data setup.
What do you think?
If you would like to do additional initialization in an image derived from this one, add one or more *.sql, *.sql.gz, or *.sh scripts under /docker-entrypoint-initdb.d (creating the directory if necessary). After the entrypoint calls initdb to create the default postgres user and database, it will run any *.sql files, run any executable *.sh scripts, and source any non-executable *.sh scripts found in that directory to do further initialization before starting the service.
Warning: scripts in /docker-entrypoint-initdb.d are only run if you start the container with a data directory that is empty; any pre-existing database will be left untouched on container startup. One common problem is that if one of your /docker-entrypoint-initdb.d scripts fails (which will cause the entrypoint script to exit) and your orchestrator restarts the container with the already initialized data directory, it will not continue on with your scripts.
The text was updated successfully, but these errors were encountered:
Yes, It will automatically create db schema or execute scripts.
in this project i have done same thing https://github.com/shamimgeek/url-shortner/blob/master/database/Dockerfile
If we create a Dockerfile
and then use it in
docker-compose-postgres-pgadmin4.yml
:then it will automatically run those sql files for data setup.
What do you think?
The text was updated successfully, but these errors were encountered: