Using the official redmine docker guide it is possible to start a redmine server connected to a postgresql database. I used the following commands:
docker run -d --name redmine_db -p 6543:5432 -e POSTGRES_PASSWORD=secret -e POSTGRES_USER=redmine postgres:9.5.1
docker run -d --name redmine_web -p 3001:3000 --link redmine_db:postgres redmine:3.2.3
But I have difficulties to run the same configuration with docker compose. Here is the first docker-compose.yml file I used:
version: '2'
services:
webserver:
image: redmine:3.2.3
ports:
- "3001:3000"
links:
- database:postgres
database:
image: postgres:9.5.1
ports:
- "6543:5432"
environment:
- POSTGRES_PASSWORD="secret"
- POSTGRES_USER="redmine"
With docker compose the redmine server starts correctly but it ignores the postgres database container and uses the internal SQLite database instead.
I've also tried with the following environments in the webserver configuration:
environment:
- POSTGRES_PORT_5432_TCP="5432"
- POSTGRES_ENV_POSTGRES_USER="redmine"
- POSTGRES_ENV_POSTGRES_PASSWORD="secret"
But without success. This time the redmine container does not start at all and displays the following error message:
[!] There was an error parsing `Gemfile`: (<unknown>): did not find expected key while parsing a block mapping at line 2 column 3. Bundler cannot continue.
# from /usr/src/redmine/Gemfile:64
# -------------------------------------------
# if File.exist?(database_file)
> database_config = YAML::load(ERB.new(IO.read(database_file)).result)
# adapters = database_config.values.map {|c| c['adapter']}.compact.uniq
# -------------------------------------------