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
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.