shitdown fails to save studies

I am using the combination of an orthanc folder with 2 files: Dockerfile and orthanc.json.
Not in this folder is docker-compose.yml

If I do a docker-compose down, that stops Orthanc and I expect to restart it via docker-compose up --build -d
This gives me an error Error starting userland proxy: listen tcp bind: address already in use

This I can solve via docker run --publish=8042:8042 --publish=104:4242 osimis/orthanc
which will start Orthanc. I can then import a study and all works well.

Then I power off my computer and power it back on. I can see that docker is starting upon power up but Orthanc is not starting properly.
The docker-compose up --build -d gives me the port 80 bind problem but run --publish=8042:8042… starts Orthanc.
The problem is that the database is now empty.

Since losing all the studies in the database is a serious problem, the question is what is the step which is causing it?
Also what am I missing in the power on, start up of docker etc which is causing Orthanc not to start properly?
(My system is Ubuntu 18.04.)

Your question is related to Docker, not to Orthanc. Please check out the Orthanc Book:

“The filesystem of Docker containers is volatile (its content is deleted once the container stops).”

Regarding the “bind: address already in use” error, the message is self-explaining: You already have a Web server that listens on port 80 (e.g. Apache or nginx), so Orthanc can’t use this port.

The “jodogne/orthanc” and “jodogne/orthanc-plugins” images are the low-level images from the Orthanc project and are documented here:

The “osimis/orthanc” images provide easier customization and other plugins (notably the Osimis Web viewer), and are documented here:

You can list the available tags to find the latest by using the following command-lines:
$ curl -s | jq ‘.[] | .name’ | sort

$ curl -s | jq ‘.[] | .name’ | sort

=> Latest tag for “jodogne/orthanc-*” is 1.5.6 (as these images follow the versioning of Orthanc), whereas the latest tag for “osimis/orthanc” is 19.6.1 (which follows a “year.month.index” scheme).