I have a git repo with my app, with a docker-compose.yml
in the root for running an environment. It uses postgres 9.1 for the database (that will be upgraded). The postgres part of the config looks like this:
db:
image: orchardup/postgresql:9.1
ports:
- 5432:5432
environment:
POSTGRESQL_USER: XXXXXXXXX
POSTGRESQL_PASS: YYYYYYYYY
POSTGRESQL_DB: my_scharona
I'd like it so that /etc/postgresql/9.1/main
in the container be mounted from db/etc
in the git repository so I could store the postgres configuration files in git. However, when I do this in the yml file:
volumes:
- ./db/etc:/etc/postgresql/9.1/main
I get the following error when starting the containers:
ERROR: Cannot link to a non running container: /ZZZZZZ_db_1 AS /ZZZZZZ_web_1/db
From what I've read in the documentation I seem to be using the right syntax. So what am I doing wrong?
Using
docker-compose up db
to launch just the db instance exposed the actual error:Since I forgot to put the config files on the host PostgreSQL didn't start.