Docker documentation with an existing database
Added by César DJ Caësar 9114 over 2 years ago
Hello,
I had a Redmine on NGINX and passenger. For some update reasons, it doesn't work anymore, so I decided to try the docker approach, but the documentation only explains how to use it with another docker for the database. What I would like is that the Redmine docker uses the database I already have, but I'm new to it and I didn't find any tutorial.
Is there any tutorial on how to run a Redmine docker with an existing database?
Second question, because the problem will come eventually: how to migrate the database with a Redmine docker? Because when you change the Redmine version you use another docker, and the database is in another place (should it be a docker or a traditionnal database).
I use this command:
docker run -d --name redmine-4.2.5 redmine -e REDMINE_DB_POSTGRES=127.0.0.1 -e REDMINE_DB_PORT=5432 -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=XXXX -e REDMINE_DB_DATABASE=redmine -e REDMINE_NO_DB_MIGRATE=1
But when I inspect the docker image, I have no IP address, so I suppose it didn't work but I don't know why.
Thanks in advance :)
Replies (1)
RE: Docker documentation with an existing database - Added by César DJ Caësar 9114 over 2 years ago
Thanks to me, I found the answer, and I'll leave it here to prevent others to waste time:
docker run -d --network=host --name redmine-4.2.5 -v /opt/redmine/files:/usr/src/redmine/files -v /var/git/git_repositories:/var/git/git_repositories -e REDMINE_DB_POSTGRES=localhost -e REDMINE_DB_PORT=5432 -e REDMINE_DB_USERNAME=redmine -e REDMINE_DB_PASSWORD=XXX -e REDMINE_DB_DATABASE=redmine -e REDMINE_NO_DB_MIGRATE=1 redmine
This command will create a container named "redmine-4.2.5" with the latest redmine image, and will connect to the host PostgreSQL database, and will use the files and the repos of the host.
NGINX and proxy_passs and you're all set!