I just started using the
osmis/orthanc image after developing from compiled source initially, so please excuse my ignorance. I do have a modified .yaml file that I am using based on the .. orthanc-setup-samples/docker/all-usages/docker-compose.yml. What I have so far is shown below at the bottom of the thread. It seems to be partially working, although I need to work with them a bit more. I just backed up the original and modified a copy after cloning the
orthanc-setup-samples folder to my computer.
1. First, it appears that you can use both the ENV variables and inline .json in combination if you want to and Docker creates a config file from that ?
2. After I start up Docker, it does recognize the StorageDirectory in the home directory of my .yaml file, and it does create and delete the image files in the Storage directory in that root folder.
3. However, the Postgres database is not mapped to my PostGresDB folder. I don't know how to do that and if it possible or advisable, but I made an attempt in the .yaml there.
4. When I uncomment:
#PYTHON_PLUGIN_ENABLED: "true"
#ORTHANC__PYTHON_SCRIPT: "/usr/share/orthanc/test.py"
#ORTHANC__PYTHON_VERBOSE: "true"
it loads the python plug-in and then crashes, but it does read the python script located in the bound folder on my system, which is good, but it crashes because I have about 4 PIP modules that are not installed my default. I know how to do that, i.e. sudo python3 -m pip install {module}, so I think I just need a way to install the ones that I need when the container is built and before Orthanc starts up.
I did find this:
https://bitbucket.org/osimis/orthanc-setup-samples/src/master/docker/python/orthanc/which includes:
FROM osimis/orthanc
RUN pip3 install pydicom
RUN mkdir /python
COPY * /python/
and some other stuff
so it looks like I just need a way to incorporate that info my build, and if I want to do some other stuff I can just modify that Docker file.
I have been off the forum a bit, so I was hoping someone has an answer to what are probably questions really for someone facile with Docker. So,
1. How advisable is it to have the StorageDirectory outside of the Docker container ?
2. Is it possible to have the Database also stored on the host file system like for (1), and how advisable is that ?
3. I do not have much experience with Docker yet. If it is better to just keep those in the container and if it can be persistent that might be OK, but I'd still want a way to back all of that up. It seems that it might in some ways easier to them on the host.
4. How can I add PIP modules during the build so that I can use my python script? That otherwise seems to be working. It seems like if I could just have a supplemental Docker file for the things that I want to add to the base image, that would work.
Thanks.
docker-compose.yml, modified from the original
#docker-compose up --build
version: "3.3"
services:
orthanc-file-in-env-var:
image: osimis/orthanc
depends_on: [index-db]
ports: ["4242:4242", "8042:8042"]
restart: 'no' # no, always, on-failure, unless-stopped
environment:
# POSTGRES is in Config file
# WORKLISTS is in Config file
VERBOSE_ENABLED: "true"
VERBOSE_STARTUP: "true"
#AUTHORIZATION_PLUGIN_ENABLED:: "false"
CONNECTIVITY_CHECKS_PLUGIN_ENABLED: "true"
DICOM_WEB_PLUGIN_ENABLED: "true"
# GDCM_PLUGIN_ENABLED: "true" #on by default
#PYTHON_PLUGIN_ENABLED: "true"
#ORTHANC__PYTHON_SCRIPT: "/usr/share/orthanc/test.py"
#ORTHANC__PYTHON_VERBOSE: "true"
SERVE_FOLDERS_PLUGIN_ENABLED: "false"
# VIEWERS
ORTHANC_WEB_VIEWER_PLUGIN_ENABLED: "false"
#OSIMIS VIEWER
OSIMIS_WEB_VIEWER1_PLUGIN_ENABLED: "true"
# STONE WEB VIEWER
STONE_WEB_VIEWER_PLUGIN_ENABLED: "true"
# StoneViewer configurations
ORTHANC__STONE_WEB_VIEWER__DATE_FORMAT: "DD/MM/YYYY"
OSIMIS_CLOUD_PLUGIN_ENABLED: "true"
ORTHANC_JSON: |
{
"Name": "CAYMANMED",
"PostgreSQL" : {
"Host": "index-db",
"Password": "pg-password"
},
"RegisteredUsers": {
"demo": "demo"
},
"RemoteAccessAllowed": true,
"AuthenticationEnabled" : false,
"Worklists": {
"Enable": true,
"Database": "/var/lib/orthanc/worklists"
}
}
volumes:
- type: bind
source: ./python/test.py
target: /usr/share/orthanc/test.py
- type: bind
source: ./MWLFiles
target: /var/lib/orthanc/worklists
- type: bind
source: ./StorageDirectory
target: /var/lib/orthanc/db/
- type: bind
source: ./PostGresDB
target: /orthanc-index/
# POSTGRES
index-db:
image: postgres
restart: unless-stopped
volumes: ["orthanc-index:/var/lib/postgresql/data:Z"]
volumes:
orthanc-index: