Answer the question
In order to leave comments, you need to log in
How to populate database data in docker container?
I just started to master docker, the question seems simple, but I don’t know which side to approach
. The application is built in a docker container, the database config is below
services:
db:
image: postgres:11.2
container_name: api_db
restart: always
volumes:
- ./data/postgresql:/var/lib/postgresql/data
Answer the question
In order to leave comments, you need to log in
A database dump in SQL format and what is on the disk of a running postgres are completely different things.
In any case, the dump will need to be somehow loaded into the database. Whether you do this over the network through a forwarded port, or throw the dump into a container and deploy it locally, it doesn't matter.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question