【问题标题】:Where does the data of postgresql container save ans, and also where the location of container is?postgresql容器的数据保存在哪里,还有容器的位置在哪里?
【发布时间】:2019-07-06 22:07:59
【问题描述】:

我正在使用来自 GitHub https://github.com/nameko/nameko-examples 的 nameko 我在 docker 上部署了这个应用程序。一旦我停止容器,所有数据都会丢失,我也无法找到容器的位置。我想将每个数据库日期存储在我的本地计算机上。

【问题讨论】:

    标签: postgresql redis docker-compose dockerfile nameko


    【解决方案1】:

    您必须为 postgres 容器安装存储。 https://github.com/nameko/nameko-examples/blob/master/docker-compose.yml

    postgres:
        container_name: nameko-example-postgres
        image: postgres
        ports:
            - "5433:5432" # Exposing Postgres on different port for convenience
        environment:
            POSTGRES_DB: "orders"
            POSTGRES_PASSWORD: "password"
            POSTGRES_USER: "postgres"
        restart: always
    

    你可以在上面的 sn-p 中添加列

      volumes:
        - ./database:/var/lib/postgresql
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-14
      • 1970-01-01
      • 2022-08-15
      • 1970-01-01
      • 1970-01-01
      • 2016-07-09
      相关资源
      最近更新 更多