Error: Postgres database import in docker container

后端 未结 4 682
情书的邮戳
情书的邮戳 2021-02-08 02:07

I\'m running a ruby on rails application in docker container. I want to create and then restore the database dump in postgres container. But I\'m

Below is what I\'ve do

4条回答
  •  醉话见心
    2021-02-08 02:28

    web_1 exited with code 0
    

    Did you tried check the log of web_1 container? docker-compose logs web

    I strongly recommend you don't initialize your db container manually, make it automatically within the process of start container.

    Look into the entrypoint of postgres, we could just put the db_dump.gz into /docker-entrypoint-initdb.d/ directory of the container, and it will be automatic execute, so docker-compose.yml could be:

    db:
      volumes:
        - './initdb.d:/docker-entrypoint-initdb.d'
    

    And put your db_dump.gz into ./initdb.d on your local machine.

提交回复
热议问题