Docker-compose environment variables

前端 未结 7 875
滥情空心
滥情空心 2021-02-01 13:44

I am trying to setup a postgres container and want to setup the postgres login with:

POSTGRES_USER: docker
POSTGRES_PASSWORD: docker

So I have

7条回答
  •  孤街浪徒
    2021-02-01 14:06

    I struggled with this for a while and wasn't having luck with the accepted answer, I finally got it to work by removing the container:

    docker-compose rm postgres
    

    And then the volume as well:

    docker volume rm myapp_postgres
    

    Then when I did a fresh docker-compose up I saw CREATE ROLE fly by, which I'm assuming is what was missed on the initial up.


    The reasons for this are elaborated on here, on the Git repo for the Docker official image for postgres.

提交回复
热议问题