Content
Docker related installation problems
Added by Ovidiu Pacuraru over 6 years ago
I am not new to Docker, nor am I an expert but I am currently not able to figure out what I am doing wrong.
The Docker image I am using is the official one from here: https://hub.docker.com/r/openproject/community/ and I have followed those “Quick Start” instructions.
here is what I have done so far:
- openproject is running on a docker host within my internal LAN at work and is not reachable from the outside, same goes for the email server indicated in the options below
- docker run -d —name openproject -p 8081:80 -v /mnt/openproject-data:/var/db/openproject -v /mnt/openproject-db:/var/lib/postgresql/9.4/main -e SECRET_KEY_BASE=mysecret -e SMTP_ADDRESS=192.168.220.2 -e SMTP_PORT=25 -e SMTP_DOMAIN=mydomain.tld openproject/community:7
- I can now access openproject via my docker-host:8081
- I log in as admin:admin and do the mandatory password change
- I change some configurations inside the openproject system settings
- I now realized I made some errors with my first docker installation so I stop, remove and start my container again
- docker stop openproject
- docker rm openproject
- docker run -d —name openproject -p 8081:80 -v /mnt/openproject-data:/var/db/openproject -v /mnt/openproject-db:/var/lib/postgresql/9.4/main -e SECRET_KEY_BASE=mysecret -e SMTP_ADDRESS=192.168.220.2 -e SMTP_PORT=25 -e SMTP_DOMAIN=mydomain.tld openproject/community:7
- I go to docker-host:8081 and find out that my new password doesn’t work and has reverted to admin:admin and all the changes to system settings I made before are lost
I am unable to figure out what I did wrong, the whole purpose of the two "v" options above was to keep persistent settings :(
-v /mnt/openproject-data:/var/db/openproject -v /mnt/openproject-db:/var/lib/postgresql/9.4/main
The indicated folders both exist and are empty. After running my container /mnt/openproject-data now has a subfolder called files but /mnt/openproject/db is still empty.
Any hints on what I am doing wrong? I don’t want to go ahead and set openproject up properly only to lose all my settings with the next update.
After some debugging, I think I might have found the problem in the logs:
-----> Database cluster not found. Creating a new one in /var/lib/postgresql/9.6/main...
Apparently the Docker iamge does no longer run postgresql 9.4 but 9.6
I am now trying to start the container like this: docker run -d —name openproject -p 8081:80 -v /mnt/openproject-data:/var/db/openproject -v /mnt/openproject-db:/var/lib/postgresql -e SECRET_KEY_BASE=mysecret -e SMTP_ADDRESS=192.168.220.2 -e SMTP_PORT=25 -e SMTP_DOMAIN=mydomain.tld —restart=unless-stopped openproject/community:7
There are no more errors in the docker container logs which I can see:
-----> Database cluster not found. Creating a new one in /var/lib/postgresql/9.6/main... The files belonging to this database system will be owned by user "postgres". This user must also own the server process.
and still the folder /mnt/openproject-db/ only contains the subfolder 9.6 with a subfolder named main which is also empty so where is my persistent DB?
Replies (2)
I have found newer installation instructions here: https://www.openproject.org/docker/
My current docker run string looks like this:
@ docker run -d —name openproject -p 8081:80 -v /mnt/openproject/pgdata:/var/lib/postgresql -v /mnt/openproject/logs:/var/log/supervisor -v /mnt/openproject/static:/var/db/openproject -e SECRET_KEY_BASE=mysecret -e SMTP_ADDRESS=192.168.220.2 -e SMTP_PORT=25 -e SMTP_DOMAIN=mydomain.tld —restart=unless-stopped openproject/community:7@
and still the /mnt/openproject/pgdata/9.6/main folder remains empty.
OK, figured it out.
You cannot use:
-v /mnt/openproject/pgdata:/var/lib/postgresql
This works:
-v /mnt/openproject/pgdata:/var/lib/postgresql/9.6/main
However to me this looks like when a newer Docker image will use another Postgresql version one might need to adapt