How to persist data in a dockerized postgres database using volumes

后端 未结 4 656
伪装坚强ぢ
伪装坚强ぢ 2020-11-28 01:32

My docker compose file has three containers, web, nginx, and postgres. Postgres looks like this:

postgres:
  container_name: postgres
  restart: always
  ima         


        
4条回答
  •  自闭症患者
    2020-11-28 01:45

    Strangely enough, the solution ended up being to change

    volumes:
      - ./postgres-data:/var/lib/postgresql
    

    to

    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    

提交回复
热议问题