Viewers: Run docker image with default settings.

Created on 19 Apr 2019  路  8Comments  路  Source: OHIF/Viewers

Considering the point of containerizing is to provide atomic, standard, self sufficient, out of the box, units of software. Would it make sense to package the docker distribution with a mongo database by default?

I ended up not using the docker container, since the local meteor installation provided sensible defaults.

Community

Most helpful comment

I found an example of the setup I'm suggesting:

@TZubiri - This may not match your particular use case, but I had recently worked with some folks that wanted a docker-compose implementation of the OHIF Viewer that used Orthanc as the data store with both MongoDB (for OHIF Viewer) and PostgreSQL (for Orthanc) containerized.

Example is here: https://github.com/mjstealey/ohif-orthanc-dimse-docker

Depending on your use case there are improvements that could be made to tighten up the edges around auth, security, etc.

All 8 comments

Docker is not my area of expertise, so more than happy to discuss.

Each unit is atomic. It does one thing and is a self-sufficient building block, but those atomic elements work together to serve up an application?

Either way, I think the separate instances emulate a production setup. If I wanted to scale, I don't think I would want to scale the database and the web server at the same rate?

Disclaimer: Docker, OHIF or MongoDB are not my area of expertise either.
The requirement to separate the database and web server for independent scaling makes sense.
Perhaps the app could be packaged with a docker compose that sets up a mongodb container along with the current OHIF container?

This way the technical components are containerized, but the docker swarm provides an atomic unit on the application level.

A nice bonus is that if someone needs to scale but doesn't know how, it's possible to add a configuration option for scaling the database, and thus version control the scaling infrastructure.

I found an example of the setup I'm suggesting:

https://hub.docker.com/_/wordpress

This image provides a docker compose with 2 images, one for wordpress and another one for mysql:

version: '3.1'

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb

  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: '1'

@Tzubiri, I think that makes sense. We've started to add docker-compose files for the various common deployments in the React branch.

I found an example of the setup I'm suggesting:

@TZubiri - This may not match your particular use case, but I had recently worked with some folks that wanted a docker-compose implementation of the OHIF Viewer that used Orthanc as the data store with both MongoDB (for OHIF Viewer) and PostgreSQL (for Orthanc) containerized.

Example is here: https://github.com/mjstealey/ohif-orthanc-dimse-docker

Depending on your use case there are improvements that could be made to tighten up the edges around auth, security, etc.

I've added some documentation for a few different deployment/usage scenarios here:

These are using some of the docker resources found here: https://github.com/OHIF/Viewers/tree/master/docker

Please let me know if you would like to see new recipes or contribute your own. I think there are a lot of valid deployment scenarios, but these should roughly cover the most popular ones.

Excellent developments here, I have been using mjstealey's docker compose and might start using it in production soon.

The recipes are a great addition Danny. The user account control even solves this other issue of mine: https://github.com/OHIF/Viewers/issues/364

I am finishing up connecting some on-premise devices, so I'll be diving into OHIF for a couple of weeks again. I'll take a deep look into the resources you posted.

Regards.

I have been using mjstealey's docker compose and might start using it in production soon.

@TZubiri - wound up adding an Nginx reverse proxy with SSL in front of the OHIF Viewer (Orthanc store) in the docker-compose file.
This keeps the exposed ports limited to http/https by default.
Other ports are still defined, just commented out in the compose file for reference.

@dannyrb - Big 馃憤 on the documentation for different deployment/usage scenarios

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MuriloSchaefer picture MuriloSchaefer  路  3Comments

trypag picture trypag  路  4Comments

panzhengo1 picture panzhengo1  路  3Comments

Diegovictorbr picture Diegovictorbr  路  4Comments

christianvargasforero picture christianvargasforero  路  4Comments