Openproject Docker Restart > Clean OpenProject

tadeus

Dabbler
Joined
Aug 29, 2019
Messages
29
Hi,

i took the docker image of openproject and installed it with the instructions from the "recommended usage" part at my freenas.

Code:
sudo mkdir -p /var/lib/openproject/{pgdata,static}

docker run -d -p 8080:80 --name openproject -e SECRET_KEY_BASE=secret \
  -v /var/lib/openproject/pgdata:/var/openproject/pgdata \
  -v /var/lib/openproject/static:/var/openproject/assets \
  openproject/community:latest


When I restart my docker virtual engine, every restart I lose my openproject settings and get a clean installed openproject.

The /var/lib directories are used from openproject, so the data i think is saved.

Whats wrong with my setup?

thank you
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
The /var/lib directories are used from openproject, so the data i think is saved.

Whats wrong with my setup?
You're saving data to the virtual HD of your docker VM... what do you see if you look at the contents of that pair of directories?

There is some chance that you haven't got the permissions correct and the mapping inside the container fails, so the right hand side path of your -v arguments exists in the container, but with no link to the host path (left hand side).

If that's the case, restart of the docker container still shouldn't cause those to be lost unless you're recreating the container...

Check the directories and see if any files are saved there or not.
 

tadeus

Dabbler
Joined
Aug 29, 2019
Messages
29
Hm i reinstalled openproject in a new docker machine and now it works :eek:
Ok so the problem is solved.

I have a additional question:
With the freenas boot, there will automatically start the docker machine in which I installed the openproject docker container.
How can I start the openproject container automatically?
 
Last edited:

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
You need to set the parameter as part of the docker run statement:
--restart unless-stopped

or

--restart always (then you can have difficulty stopping it to do maintenance, so be careful)

You can use portainer to adjust that parameter of an existing container. (or you can google the docker command line if you don't use or don't want to use portainer)
 

tadeus

Dabbler
Joined
Aug 29, 2019
Messages
29
ok, thank you but it will not work.
i can do a "docker start/stop openproject" but when I do a "docker run openproject" I get this message:
docker: Error response from daemon: pull access denied for openproject, repository does not exist or may require 'docker login'.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702
if you already created the container (can use start/stop) then you can't change the run statement as I suggested by just using run... as I said, look up the syntax for that in docker or use portainer.
 
Top