Answer the question
In order to leave comments, you need to log in
How can a table be created on Docker Postgres Image initialization?
Hello everybody! How can I create a table on the initialization of a Docker container with Postgres?
Answer the question
In order to leave comments, you need to log in
Everything is very simple. Go to the container documentation, here is the address https://hub.docker.com/_/postgres
there look for the item Initialization scripts , everything
is described there script what you need to do when you first start the container and place it in a certain place in the container (mount it as a volume), start the container, create a base there, after the container starts your script - creates users, tables, rights, uploads data, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question