Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mjstealey committed Apr 25, 2019
1 parent 3ed2b9d commit 5736d1d
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 52 deletions.
150 changes: 99 additions & 51 deletions README.md
@@ -1,6 +1,56 @@
# Orthanc in Docker with PostgreSQL
# OHIF Viewer/Orthanc in Docker

Docker Compose implementation of OHIF Viewer with Orthanc:

- Orthanc: [jodogne/orthanc-plugins:latest](https://hub.docker.com/r/jodogne/orthanc-plugins)
- PostgreSQL 11: [postgres:11](https://hub.docker.com/_/postgres)
- OHIF Viewer: [viewer:travis-757](https://hub.docker.com/r/ohif/viewer)
- MongoDB: [mongo:latest](https://hub.docker.com/_/mongo)


Orthanc docker containers as described at [http://book.orthanc-server.com/users/docker.html](http://book.orthanc-server.com/users/docker.html)

OHIF Viewer docker containers as described at [https://github.com/OHIF/Viewers](https://github.com/OHIF/Viewers)

Sample DICOM images downloaded from [https://www.dicomlibrary.com](https://www.dicomlibrary.com)

## TL;DR

Start postgres and mongo 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`)

```
docker-compose up -d postgres mongo
```

Start orthanc and viewer

```
docker-compose up -d orthanc viewer
```

Once completed you should see four containers running

```console
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------
mongo docker-entrypoint.sh mongod Up 0.0.0.0:27017->27017/tcp
orthanc Orthanc /etc/orthanc/ Up 0.0.0.0:4242->4242/tcp, 0.0.0.0:8042->8042/tcp
postgres docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
viewer pm2-runtime app.json Up 0.0.0.0:3000->3000/tcp
```

Go to [http://localhost:8042/]() and Sign in

- Username: **orthanc**
- Password: **orthanc**

Load the sample data from the `dicom-samples` directory (Upload tab)

Go to [http://localhost:3000/studylist]() and double click on the loaded study

Enjoy!

Docker Compose implementation of the [jodogne/orthanc-plugins:latest](https://hub.docker.com/r/jodogne/orthanc-plugins) and [postgres:11](https://hub.docker.com/_/postgres) docker containers as described at [http://book.orthanc-server.com/users/docker.html](http://book.orthanc-server.com/users/docker.html).

## Usage

Expand All @@ -25,7 +75,7 @@ ORTHANC_HTTP_PORT=8042

Update the docker-compose.yml file to appropriaty map the volume mounts for PostgreSQL database data and Orthanc data. Defaults are present working directory from where the compose file is invoked.

```docker-compose
```docker
...
postgres:
...
Expand All @@ -48,69 +98,53 @@ Update the docker-compose.yml file to appropriaty map the volume mounts for Post

Run the services defined in docker-compose.yml and daemonize them.

The postgres and mongo containers should be started first

```
docker-compose up -d
docker-compose up -d postgres mongo
```

You should notice two containers running on the host.

```console
$ docker-compose ps
Name Command State Ports
---------------------------------------------------------------------------
mongo docker-entrypoint.sh mongod Up 0.0.0.0:27017->27017/tcp
postgres docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
```

Next start the orthanc and viewer containers

```
docker-compose up -d orthanc viewer
```

Once completed you should see four containers running

```console
$ docker-compose ps
Name Command State Ports
-------------------------------------------------------------------------------------------------
orthanc /docker-entrypoint.sh Up 0.0.0.0:4242->4242/tcp, 0.0.0.0:8042->8042/tcp
mongo docker-entrypoint.sh mongod Up 0.0.0.0:27017->27017/tcp
orthanc Orthanc /etc/orthanc/ Up 0.0.0.0:4242->4242/tcp, 0.0.0.0:8042->8042/tcp
postgres docker-entrypoint.sh postgres Up 0.0.0.0:5432->5432/tcp
viewer pm2-runtime app.json Up 0.0.0.0:3000->3000/tcp
```

It will take a few moments for the `orthanc` container to complete it's start up scripts, but when completed the container logs should look similar to this:
It will take a few moments for the `posgres` container to complete it's start up scripts, but when completed the container logs should look similar to this:

```console
$ docker-compose logs postgres
...
orthanc | W0424 15:07:31.925776 PluginsManager.cpp:168] Clearing the cache of the Web viewer
orthanc | W0424 15:07:31.930110 PluginsManager.cpp:168] Web viewer using a cache of 100 MB
orthanc | W0424 15:07:31.930159 PluginsManager.cpp:168] Using GDCM instead of the DICOM decoder that is built in Orthanc
orthanc | W0424 15:07:31.930789 PluginsManager.cpp:269] Registering plugin 'wsi' (version mainline)
orthanc | W0424 15:07:31.931034 PluginsManager.cpp:168] The whole-slide imaging plugin will use at most 4 threads to transcode the tiles
orthanc | W0424 15:07:31.931741 PluginsManager.cpp:269] Registering plugin 'postgresql-index' (version mainline)
orthanc | W0424 15:07:31.932179 main.cpp:1224] Using a custom database from plugins
orthanc | W0424 15:07:31.932224 main.cpp:1235] Using a custom storage area from plugins
orthanc | W0424 15:07:32.341265 PluginsManager.cpp:168] Trying to enable trigram matching on the PostgreSQL database to speed up wildcard searches. This may take several minutes
orthanc | W0424 15:07:32.421550 PluginsManager.cpp:168] Trigram index has been created
orthanc | W0424 15:07:32.500199 HttpClient.cpp:744] HTTPS will use the CA certificates from this file: /etc/orthanc/
orthanc | W0424 15:07:32.501409 LuaContext.cpp:103] Lua says: Lua toolbox installed
orthanc | W0424 15:07:32.501825 LuaContext.cpp:103] Lua says: Lua toolbox installed
orthanc | W0424 15:07:32.502192 ServerContext.cpp:316] Disk compression is disabled
orthanc | W0424 15:07:32.502265 ServerIndex.cpp:1613] No limit on the number of stored patients
orthanc | W0424 15:07:32.503269 ServerIndex.cpp:1630] No limit on the size of the storage area
orthanc | W0424 15:07:32.505496 JobsEngine.cpp:283] The jobs engine has started with 2 threads
orthanc | W0424 15:07:32.506172 main.cpp:932] DICOM server listening with AET ORTHANC on port: 4242
orthanc | W0424 15:07:32.506236 HttpServer.cpp:1155] HTTP compression is enabled
orthanc | W0424 15:07:32.509634 HttpServer.cpp:1062] HTTP server listening on port: 8042 (HTTPS encryption is disabled, remote access is allowed)
orthanc | W0424 15:07:32.509688 main.cpp:712] Orthanc has started
```

At this point the **orthanc** database of the `postgres` container should also have the required tables as defined by Orthanc.

```console
$ docker exec -u postgres postgres psql -d orthanc -c '\dt;'
List of relations
Schema | Name | Type | Owner
--------+-----------------------+-------+----------
public | attachedfiles | table | postgres
public | changes | table | postgres
public | deletedfiles | table | postgres
public | deletedresources | table | postgres
public | dicomidentifiers | table | postgres
public | exportedresources | table | postgres
public | globalintegers | table | postgres
public | globalproperties | table | postgres
public | maindicomtags | table | postgres
public | metadata | table | postgres
public | patientrecyclingorder | table | postgres
public | remainingancestor | table | postgres
public | resources | table | postgres
public | storagearea | table | postgres
(14 rows)
postgres |
postgres | PostgreSQL init process complete; ready for start up.
postgres |
postgres | 2019-04-25 19:01:47.301 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres | 2019-04-25 19:01:47.301 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres | 2019-04-25 19:01:47.305 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres | 2019-04-25 19:01:47.392 UTC [61] LOG: database system was shut down at 2019-04-25 19:01:47 UTC
postgres | 2019-04-25 19:01:47.420 UTC [1] LOG: database system is ready to accept connections
```

### Validate in browser
Expand All @@ -127,3 +161,17 @@ Once signed in the explorer page should be presented:
<img width="80%" alt="home page" src="docs/imgs/orthanc-home.png">


## Clean up

```
docker-compose stop && docker-compose rm -f
docker volume prune -f
docker network prune -f
rm -rf mongo_data orthanc_db pg_data
```

## References

- Othanc: [http://book.orthanc-server.com/index.html](http://book.orthanc-server.com/index.html)
- OHIF Viewer: [https://docs.ohif.org](https://docs.ohif.org)
- DICOM Library: [https://www.dicomlibrary.com](https://www.dicomlibrary.com)
2 changes: 1 addition & 1 deletion config/viewer.json
Expand Up @@ -29,7 +29,7 @@
"defaultServiceType": "dicomWeb",
"public": {
"ui": {
"studyListDateFilterNumDays": 100
"studyListDateFilterNumDays": 7000
}
},
"proxy": {
Expand Down

0 comments on commit 5736d1d

Please sign in to comment.