A
A
Artem2018-10-14 20:09:01
Docker
Artem, 2018-10-14 20:09:01

How to create tables when running a docker postgres container?

How to create tables, functions, links, etc. in the database when building a postgres container?
Conventionally, there are *.psql script files that create everything you need. How can I set up docker-compose and docker so that these scripts run after postgres is started?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Talik, 2018-10-15
@Cruper

If you are using a third-party image, then you can override the enrypoint in which you will cause the creation of tables after raising the container

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question