I have done everything as told in the docker compose lecture. They did not told about using the environment variable in postgres. When i was not using the environment variable my container was stopping. So i used the environment variable and started a new container my database started working fine. But when i use this in docker-compose.yml it gives authentication error.
This is my docker file
redis:
image: redis
db:
image: postgres:9.4
environment:
POSTGRES_PASSWORD: postgres
worker:
image: worker-app
links:
- db
- redis
vote:
image: voting-app
ports:
- 5000:80
links:
- redis
result:
image: result-app
ports:
- 5001:80
links:
- db
This is the Error
db_1 | FATAL: password authentication failed for user “postgres”
db_1 | DETAIL: Connection matched pg_hba.conf line 95: “host all all all md5”
result_1 | Waiting for db