From 786d76bdd05d8f9e0df1584a4e76f505a746cd18 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Thu, 29 Mar 2018 12:06:53 +0200 Subject: [PATCH] Update dockerfile a bit --- docker-compose.yml | 8 ++++---- dockerfile | 17 ++++++----------- dockersupport/app.json | 30 +++++++++++++++++++++++++++++- dockersupport/ohifviewer.env | 36 ------------------------------------ 4 files changed, 39 insertions(+), 52 deletions(-) delete mode 100644 dockersupport/ohifviewer.env diff --git a/docker-compose.yml b/docker-compose.yml index dc36e8b08..6ca7fd6e4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,14 +6,14 @@ services: - "27017:27017" viewer: - #image: ohifviewer:latest - build: . + image: ohif/viewer:latest ports: - "3000:3000" links: - mongo - env_file: dockersupport/ohifviewer.env # TODO: Doesn't look like METEOR Settings are being used properly? environment: - MONGO_URL=mongodb://mongo:27017/ohif extra_hosts: - - "localpacs:192.168.1.11" \ No newline at end of file + - "pacsIP:192.168.1.11" + volumes: + - /opt/docker/ohif-viewer/app.json:/app/app.json \ No newline at end of file diff --git a/dockerfile b/dockerfile index bbd8e20a8..906bac087 100644 --- a/dockerfile +++ b/dockerfile @@ -15,11 +15,12 @@ RUN curl https://install.meteor.com/ | sh # Create a non-root user RUN useradd -ms /bin/bash user USER user +RUN mkdir /home/user/Viewers +COPY OHIFViewer/package.json /home/user/Viewers/OHIFViewer/ ADD --chown=user:user . /home/user/Viewers WORKDIR /home/user/Viewers/OHIFViewer -RUN meteor npm install ENV METEOR_PACKAGE_DIRS=../Packages RUN meteor build --directory /home/user/app WORKDIR /home/user/app/bundle/programs/server @@ -27,24 +28,18 @@ RUN npm install --production # Second stage of multi-stage build # Creates a slim production image for the node.js application -# -# TODO: Switch to node:8.10.0-alpine for size purposes. I was getting Segmentation Faults from the node -# process. There are probably some minor changes to be made to ensure it works. FROM node:8.10.0-slim -WORKDIR /app -COPY --from=builder /home/user/app . - RUN npm install -g pm2 -ADD dockersupport/app.json . +WORKDIR /app +COPY --from=builder /home/user/app . +COPY dockersupport/app.json . ENV ROOT_URL http://localhost:3000 ENV PORT 3000 -ENV NODE_ENV development +ENV NODE_ENV production EXPOSE 3000 -WORKDIR /app CMD ["pm2-runtime", "app.json"] - diff --git a/dockersupport/app.json b/dockersupport/app.json index bae41f8ec..8e2f33bb4 100644 --- a/dockersupport/app.json +++ b/dockersupport/app.json @@ -4,6 +4,34 @@ "script" : "main.js", "watch" : true, "merge_logs" : true, - "cwd" : "/app/bundle/" + "cwd" : "/app/bundle/", + "env": { + "METEOR_SETTINGS": { + "servers": { + "dicomWeb": [ + { + "name": "Orthanc", + "wadoUriRoot": "http://pacsIP:8042/wado", + "qidoRoot": "http://pacsIP:8042/dicom-web", + "wadoRoot": "http://pacsIP:8042/dicom-web", + "qidoSupportsIncludeField": false, + "imageRendering": "wadouri", + "thumbnailRendering": "wadors", + "requestOptions": { + "auth": "orthanc:orthanc", + "logRequests": true, + "logResponses": false, + "logTiming": true + } + } + ] + }, + "defaultServiceType": "dicomWeb", + "public": {}, + "proxy": { + "enabled": true + } + } + } }] } \ No newline at end of file diff --git a/dockersupport/ohifviewer.env b/dockersupport/ohifviewer.env deleted file mode 100644 index 0d911fe8d..000000000 --- a/dockersupport/ohifviewer.env +++ /dev/null @@ -1,36 +0,0 @@ -METEOR_SETTINGS = "{ - "servers": { - "dicomWeb": [ - { - "name": "Orthanc", - "wadoUriRoot": "http://localpacs:8042/wado", - "qidoRoot": "http://localpacs:8042/dicom-web", - "wadoRoot": "http://localpacs:8042/dicom-web", - "qidoSupportsIncludeField": false, - "imageRendering": "wadouri", - "thumbnailRendering": "wadors", - "requestOptions": { - "auth": "orthanc:orthanc", - "logRequests": true, - "logResponses": false, - "logTiming": true - } - } - ] - }, - "defaultServiceType": "dicomWeb", - "dropCollections": true, - "public": { - "verifyEmail": false, - "ui": { - "studyListFunctionsEnabled": true, - "leftSidebarOpen": false, - "displaySetNavigationLoopOverSeries": false, - "displaySetNavigationMultipleViewports": true, - "autoPositionMeasurementsTextCallOuts": "TRLB" - } - }, - "proxy": { - "enabled": true - } -}"