我正在尝试使用docker-compose运行redmine和postgres。但是当redmine容器链接到postgres时遇到了问题。
我的docker-compose:
version: '3.1'
services:
postgres:
image: postgres:latest
restart: always
networks:
- redmine
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- 'POSTGRES_PASSWORD=password'
- 'POSTGRES_DB=redmine'
redmine:
image: redmine:latest
restart: always
networks:
- redmine
volumes:
- redmine-data:/usr/src/redmine/files
ports:
- 80:3000
environment:
- 'REDMINE_DB_POSTGRES=postgres'
- 'REDMINE_DB_DATABASE=redmine'
- 'REDMINE_DB_PASSWORD=password'
volumes:
postgres-data:
redmine-data:
networks:
redmine:
driver: bridge
然后我得到了错误:
2019-02-12 09:03:31.117 UTC [39] FATAL: password authentication failed for user "postgres"
postgres_1 | 2019-02-12 09:03:31.117 UTC [39] DETAIL: Role "postgres" does not exist.
你对这个问题有想法吗?谢谢