{"id":16532824,"url":"https://github.com/mjstealey/ohif-orthanc-dimse-docker","last_synced_at":"2025-03-21T09:32:04.302Z","repository":{"id":93420577,"uuid":"183255617","full_name":"mjstealey/ohif-orthanc-dimse-docker","owner":"mjstealey","description":"OHIF Viewer and Orthanc (core with plugins) defined as docker-compose services","archived":false,"fork":false,"pushed_at":"2020-01-10T20:42:40.000Z","size":8103,"stargazers_count":54,"open_issues_count":3,"forks_count":39,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-17T23:49:54.317Z","etag":null,"topics":["dimse","docker","docker-compose","nginx","ohif-viewer","orthanc","postgres","self-signed-certificate"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mjstealey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-24T15:21:30.000Z","updated_at":"2025-03-17T12:07:19.000Z","dependencies_parsed_at":"2023-03-22T12:32:39.425Z","dependency_job_id":null,"html_url":"https://github.com/mjstealey/ohif-orthanc-dimse-docker","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"cb41de1f49f4ea0d6866d97d89eecef48269ddf3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjstealey%2Fohif-orthanc-dimse-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjstealey%2Fohif-orthanc-dimse-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjstealey%2Fohif-orthanc-dimse-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mjstealey%2Fohif-orthanc-dimse-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mjstealey","download_url":"https://codeload.github.com/mjstealey/ohif-orthanc-dimse-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244772374,"owners_count":20507974,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dimse","docker","docker-compose","nginx","ohif-viewer","orthanc","postgres","self-signed-certificate"],"created_at":"2024-10-11T18:13:30.819Z","updated_at":"2025-03-21T09:32:03.829Z","avatar_url":"https://github.com/mjstealey.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# OHIF Viewer - Orthanc with DIMSE - Nginx reverse proxy\n\n---\n\n**NOTE**: The OHIF Viewer code has changed a fair bit since this repository was originally created and as such the `:latest` tagged Docker reference no longer works with my particular setup at this time. The `docker-compose.yml` file has been updated to reflect the most recent known working versions for each image as they pertain to this particular repository. I do plan to update this at a future date, but wanted to leave things in a working order in the meantime, even if the image references are a bit out of date.\n\n---\n\nDocker Compose implementation of OHIF Viewer using Orthanc with DIMSE and Nginx reverse proxy\n\n- OHIF Viewer: [ohif/viewer:v1.x](https://hub.docker.com/r/ohif/viewer)\n- MongoDB: [mongo:4.0.14](https://hub.docker.com/_/mongo)\n- Orthanc: [jodogne/orthanc-plugins:1.5.8](https://hub.docker.com/r/jodogne/orthanc-plugins)\n- PostgreSQL 11: [postgres:12.1](https://hub.docker.com/_/postgres)\n- Nginx: [nginx:1.7.7](https://hub.docker.com/_/nginx/)\n\nThis work is intended to be a complete working example of a docker based deployment demonstrating the OHIF Viewer using Orthanc as the image store served using Nginx and self signed SSL certificates. This work should not be considered production as presented, but rather a sane starting point for further implementation of security related features.\n\n- Orthanc docker containers as described at [http://book.orthanc-server.com/users/docker.html](http://book.orthanc-server.com/users/docker.html)\n- OHIF Viewer docker containers as described at [https://github.com/OHIF/Viewers](https://github.com/OHIF/Viewers)\n- Sample DICOM images downloaded from [https://www.dicomlibrary.com](https://www.dicomlibrary.com)\n\n## TL;DR\n\nRun the services defined in docker-compose.yml and daemonize them.\n\n```\ndocker-compose up -d\n```\n\nOnce completed you should see five containers running\n\n```console\n$ docker-compose ps\n  Name                Command              State                      Ports\n----------------------------------------------------------------------------------------------\nmongo      docker-entrypoint.sh mongod     Up      27017/tcp\nnginx      nginx -g daemon off;            Up      0.0.0.0:8443-\u003e443/tcp, 0.0.0.0:8080-\u003e80/tcp\northanc    Orthanc /etc/orthanc/           Up      4242/tcp, 8042/tcp\npostgres   docker-entrypoint.sh postgres   Up      5432/tcp\nviewer     pm2-runtime app.json            Up      3000/tcp\n```\nWait a few moments for the setup scripts to run and go to [https://127.0.0.1:8443/](https://127.0.0.1:8443/) (You may be prompted to manually accept the SSL certificate because it is self signed)\n\nWe've not loaded any study images yet, so you should simply see the OHIF Viewer with **No matching results** being displayed.\n\n\u003cimg width=\"80%\" alt=\"OHIF Viewer - initial\" src=\"https://user-images.githubusercontent.com/5332509/58113815-659b6500-7bc4-11e9-9746-18573b9ed988.png\"\u003e\n\nNext, navigate to [https://127.0.0.1:8443/orthanc](https://127.0.0.1:8443/orthanc) and Sign in\n\n- Username: **orthanc**\n- Password: **orthanc**\n\nOnce signed in, load the sample data from the `dicom-samples` directory (Upload tab)\n\n\u003cimg width=\"80%\" alt=\"Orthanc - select files\" src=\"https://user-images.githubusercontent.com/5332509/58114399-a9429e80-7bc5-11e9-887f-930077cb0e76.png\"\u003e\n\nGo to [https://127.0.0.1:8443/studylist](https://127.0.0.1:8443/studylist) and double click on the loaded study\n\n\u003cimg width=\"80%\" alt=\"OHIF Viewer - interact with study\" src=\"https://user-images.githubusercontent.com/5332509/58115596-6e8e3580-7bc8-11e9-8fa6-38fb233d20a2.png\"\u003e\n\nEnjoy!\n\n**DEPLOYMENT NOTE**\n\nPresently the **orthanc** container does not have any graceful checks for when the **postgres** container is ready to accept connections, so it can potentially fail and restart (along with the nginx container) prior to gaining a successful connection. It would be preferable to start the **postgres** container first, and then start the **orthanc** container once PostgreSQL is ready.\n\nStart the postgres and mongo containers, and wait for postgres to finish it's setup (Look for **_database system is ready to accept connections_** when looking at the output of `docker-compose logs postgres`)\n\n```\ndocker-compose up -d postgres mongo\n```\n\nOnce the **postgres** container has finished it's setup, then start **nginx**, **orthanc** and **viewer** containers\n\n```\ndocker-compose up -d nginx orthanc viewer\n```\n\n## Configuration and Usage\n\n### Update `.env` file\n\nThe `.env` file defines the Nginx, OHIF Viewer, MongoDB, Orthanc and PostgreSQL parameters that will be used by the Docker containers running your services. The default values are shown below.\n\n```bash\n# Nginx configuration\nNGINX_DEFAULT_CONF=./nginx/default.conf\nNGINX_SSL_CERT=./ssl/ssl_dev.crt\nNGINX_SSL_KEY=./ssl/ssl_dev.key\n\n# OHIF Viewer\nVIEWER_CONFIG=./config/viewer.json\n\n# MongoDB\nMONGO_DATA_MNT=./mongo_data\nMONGO_PORT=27017\nMONGO_URL=mongodb://mongo:27017/ohif\n\n# Orthanc core with plugins\nORTHANC_CONFIG=./config/orthanc.json\nORTHANC_DB_MNT=./orthanc_db\nORTHANC_DICOM_PORT=4242\nORTHANC_HTTP_PORT=8042\n\n# PostgreSQL database - default values should not be used in production\nPGDATA=/var/lib/postgresql/data\nPOSTGRES_DB=orthanc\nPOSTGRES_DATA_MNT=./pg_data/data\nPOSTGRES_PASSWORD=pgpassword\nPOSTGRES_PORT=5432\nPOSTGRES_USER=postgres\n```\n\n**NOTE**: The default configuration files for Orthanc and OHIF Viewer are in the [config/](config) directory. It is left to the user to update these for their own use. Links to supporting documentation can be found in the References section.\n\n### Run the compose services\n\nRun the services defined in docker-compose.yml and daemonize them. You'll notice that only the `http` and `https` ports have been left exposed to the host. The values for other container ports have been left in the docker-compose.yml file for reference, but have been commented out.\n\nPort defaults for provided example:\n\n- HTTP: `8080` (Nginx config will redirect to the HTTPS port)\n- HTTPS: `8443`\n\nThe **postgres** and **mongo** containers should be started first\n\n```\ndocker-compose up -d postgres mongo\n```\n\nYou should notice two containers running on the host.\n\n```console\n$ docker-compose ps\n  Name                Command              State     Ports\n------------------------------------------------------------\nmongo      docker-entrypoint.sh mongod     Up      27017/tcp\npostgres   docker-entrypoint.sh postgres   Up      5432/tcp\n```\n\nIt will take a few moments for the **postgres** container to complete it's start up scripts, but when completed the container logs should look similar to this:\n\n```console\n$ docker-compose logs postgres\n...\npostgres    |\npostgres    | PostgreSQL init process complete; ready for start up.\npostgres    |\npostgres    | 2019-05-21 16:26:58.469 UTC [1] LOG:  listening on IPv4 address \"0.0.0.0\", port 5432\npostgres    | 2019-05-21 16:26:58.470 UTC [1] LOG:  listening on IPv6 address \"::\", port 5432\npostgres    | 2019-05-21 16:26:58.473 UTC [1] LOG:  listening on Unix socket \"/var/run/postgresql/.s.PGSQL.5432\"\npostgres    | 2019-05-21 16:26:58.561 UTC [62] LOG:  database system was shut down at 2019-05-21 16:26:58 UTC\npostgres    | 2019-05-21 16:26:58.594 UTC [1] LOG:  database system is ready to accept connections\n```\n\nNext start the **nginx**, **orthanc** and **viewer** containers\n\n```\ndocker-compose up -d nginx orthanc viewer\n```\n\nOnce completed you should see five containers running\n\n```console\n$ docker-compose ps\n  Name                Command              State                      Ports\n----------------------------------------------------------------------------------------------\nmongo      docker-entrypoint.sh mongod     Up      27017/tcp\nnginx      nginx -g daemon off;            Up      0.0.0.0:8443-\u003e443/tcp, 0.0.0.0:8080-\u003e80/tcp\northanc    Orthanc /etc/orthanc/           Up      4242/tcp, 8042/tcp\npostgres   docker-entrypoint.sh postgres   Up      5432/tcp\nviewer     pm2-runtime app.json            Up      3000/tcp\n```\n\n### Validate OHIF Viewer in browser\n\nIf using the default configuration as defined above, the Studylist will be available at: [https://127.0.0.1:8443/studylist](https://127.0.0.1:8443/studylist) (You may be prompted to manually accept the SSL certificate because it is self signed)\n\n\u003cimg width=\"80%\" alt=\"OHIF Viewer - initial\" src=\"https://user-images.githubusercontent.com/5332509/58113815-659b6500-7bc4-11e9-9746-18573b9ed988.png\"\u003e\n\nWe've not loaded any study images yet, so you should simply see the OHIF Viewer with **No matching results** being displayed.\n\n### Validate Orthanc in browser\n\nNext, navigate to [https://127.0.0.1:8443/orthanc](https://127.0.0.1:8443/orthanc) and Sign in\n\n- Username: **orthanc**\n- Password: **orthanc**\n\n\u003cimg width=\"80%\" alt=\"Orthanc - login\" src=\"https://user-images.githubusercontent.com/5332509/58114070-f8d49a80-7bc4-11e9-95f8-975f9f23cd04.png\"\u003e\n\nOnce signed in the explorer page should be presented\n\n\u003cimg width=\"80%\" alt=\"Orthanc - initial\" src=\"https://user-images.githubusercontent.com/5332509/58114118-1275e200-7bc5-11e9-8bd3-ad8103d9acd5.png\"\u003e\n\n### Load DICOM study images in Orthanc\n\nA small set of DICOM sample images have been included in the repository for testing purposes.\n\nClick the Upload link in the upper right corner and select files to upload from the [dicom-samples/](dicom-samples) directory.\n\n\u003cimg width=\"80%\" alt=\"Orthanc - select files\" src=\"https://user-images.githubusercontent.com/5332509/58114399-a9429e80-7bc5-11e9-887f-930077cb0e76.png\"\u003e\n\nStart the upload\n\n\u003cimg width=\"80%\" alt=\"Orthanc - upload files\" src=\"https://user-images.githubusercontent.com/5332509/58114634-2c63f480-7bc6-11e9-8424-c063709c466f.png\"\u003e\n\nFrom the Orthanc home page, select \"All studies\", and the uploaded files should be available as **Anonymized - CT1 abdomen**\n\n\u003cimg width=\"80%\" alt=\"Orthanc - all studies\" src=\"https://user-images.githubusercontent.com/5332509/58114776-7c42bb80-7bc6-11e9-81d6-d4acb2a08a4f.png\"\u003e\n\nClick the study and use the tools to interact with the loaded files\n\n\u003cimg width=\"80%\" alt=\"Orthanc - select study\" src=\"https://user-images.githubusercontent.com/5332509/58114819-97153000-7bc6-11e9-896f-ff0fea405e88.png\"\u003e\n\n### Work with loaded images in OHIF Viewer\n\nGoing back to the OHIF Viewer you should observe the Anonymized study we loaded from Orthanc as an option to interact with: [https://127.0.0.1:8443/studylist](https://127.0.0.1:8443/studylist)\n\n\u003cimg width=\"80%\" alt=\"OHIF Viewer - anon study\" src=\"https://user-images.githubusercontent.com/5332509/58115493-2cfd8a80-7bc8-11e9-9738-41dc71cf23ac.png\"\u003e\n\nDouble click on the Anonymized study to load and interact with it\n\n\u003cimg width=\"80%\" alt=\"OHIF Viewer - interact with study\" src=\"https://user-images.githubusercontent.com/5332509/58115596-6e8e3580-7bc8-11e9-8fa6-38fb233d20a2.png\"\u003e\n\n\n## Clean up\n\n```\ndocker-compose stop \u0026\u0026 docker-compose rm -f\ndocker volume prune -f\ndocker network prune -f\nrm -rf mongo_data orthanc_db pg_data\n```\n\n**NOTE**: The `rm` call from above may likely require sudo level privilege since the directories will be owned by root (or another user that is not your user ID)\n\n## References\n\n- Othanc: [http://book.orthanc-server.com/index.html](http://book.orthanc-server.com/index.html)\n- OHIF Viewer: [https://docs.ohif.org](https://docs.ohif.org)\n- DICOM Library: [https://www.dicomlibrary.com](https://www.dicomlibrary.com)\n- Nginx reverse proxy: [https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjstealey%2Fohif-orthanc-dimse-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmjstealey%2Fohif-orthanc-dimse-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmjstealey%2Fohif-orthanc-dimse-docker/lists"}