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 had a similar situation. Following the answer from @Greg, I did a docker-compose up, and it picked up the environment variable.
Prior to that, I had just been using docker-compose run and it wasn't picking up the environment variable as proven by running docker-compose exec task env. Strangely, docker-compose run task env showed the environment variable I was expecting.