0

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?

Justin Dearing
  • 1,017
  • 10
  • 33

1 Answers1

0

Using docker-compose up db to launch just the db instance exposed the actual error:

zippy1981@zippy1981-Inspiron-15-7568:~/src/XXXXXXXXX$ docker-compose up db
Recreating XXXXXXXXX_db_1
Attaching to XXXXXXXXX_db_1
db_1 | postgres cannot access the server configuration file "/etc/postgresql/9.1/main/postgresql.conf": No such file or directory

Since I forgot to put the config files on the host PostgreSQL didn't start.

Justin Dearing
  • 1,017
  • 10
  • 33