From 5af834d3d6e755e55d8d937547ace6fa39925626 Mon Sep 17 00:00:00 2001 From: Alain Mazy Date: Wed, 26 Jun 2024 12:08:46 +0200 Subject: [PATCH] fix wrong bulkDataUri --- docker/ohif-test/docker-compose.yml | 12 +++++++++ docker/ohif-test/ohif-v3.js | 12 +++++++-- docker/ohif-test/ohif/Dockerfile | 41 +++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) create mode 100644 docker/ohif-test/ohif/Dockerfile diff --git a/docker/ohif-test/docker-compose.yml b/docker/ohif-test/docker-compose.yml index 358359b..500757d 100644 --- a/docker/ohif-test/docker-compose.yml +++ b/docker/ohif-test/docker-compose.yml @@ -32,5 +32,17 @@ services: - ./nginx_ohif.conf:/etc/nginx/conf.d/default.conf:ro - ./ohif-v3.js:/usr/share/nginx/html/app-config.js:ro + ohif_v3_build: + # to build this image: + # mkdir -p /tmp/ohif && cd /tmp/ohif + # git clone https://github.com/OHIF/Viewers.git && cd /tmp/ohif/Viewers && git checkout 6c9a4d9758a72f0aca7c941dc676df0ec12b973f + # docker build -t ohif:v3-fix-wrong-url . + image: ohif:v3-fix-wrong-url + ports: + - 3004:80 + volumes: + - ./nginx_ohif.conf:/etc/nginx/conf.d/default.conf:ro + - ./ohif-v3.js:/usr/share/nginx/html/app-config.js:ro + volumes: testdata_db: \ No newline at end of file diff --git a/docker/ohif-test/ohif-v3.js b/docker/ohif-test/ohif-v3.js index 700fd2b..ae4499a 100644 --- a/docker/ohif-test/ohif-v3.js +++ b/docker/ohif-test/ohif-v3.js @@ -23,8 +23,16 @@ window.config = { supportsFuzzyMatching: false, supportsWildcard: true, staticWado: true, - singlepart: 'bulkdata,pdf,video', - acceptHeader: [ 'multipart/related; type=application/octet-stream; transfer-syntax=*'] + singlepart: 'bulkdata', + acceptHeader: [ 'multipart/related; type=application/octet-stream; transfer-syntax=*'], + bulkDataURI: { + enabled: true, + relativeResolution: 'studies', + // In this scenario, Orthanc is not aware that is being served at http://localhost/orthanc/ so we must tell OHIF to fix + // the bulkDataURI + startsWith: 'http://localhost/', + prefixWith: '/orthanc/', + }, }, }], defaultDataSourceName: 'dicomweb', diff --git a/docker/ohif-test/ohif/Dockerfile b/docker/ohif-test/ohif/Dockerfile new file mode 100644 index 0000000..6d41cda --- /dev/null +++ b/docker/ohif-test/ohif/Dockerfile @@ -0,0 +1,41 @@ +###################################################### + +FROM node:18.16.1-slim AS builder + +RUN apt-get update && apt-get install -y git build-essential python3 + +WORKDIR /sources +RUN git clone https://github.com/OHIF/Viewers.git && cd /sources/Viewers && git checkout 6c9a4d9758a72f0aca7c941dc676df0ec12b973f +RUN cp -r /sources/ /usr/src/app/ +RUN ls -al /usr/src/app/ + +WORKDIR /usr/src/app + +# Run the install before copying the rest of the files +RUN yarn config set workspaces-experimental true +RUN yarn install --frozen-lockfile --verbose + +ENV PATH /usr/src/app/node_modules/.bin:$PATH +ENV QUICK_BUILD true +# ENV GENERATE_SOURCEMAP=false +# ENV REACT_APP_CONFIG=config/default.js + +RUN yarn run build + +# Stage 3: Bundle the built application into a Docker container +# which runs Nginx using Alpine Linux +FROM nginxinc/nginx-unprivileged:1.25-alpine as final +#RUN apk add --no-cache bash +ENV PORT=80 +RUN rm /etc/nginx/conf.d/default.conf +USER nginx +COPY --chown=nginx:nginx --from=builder /sources/.docker/Viewer-v3.x /usr/src +RUN chmod 777 /usr/src/entrypoint.sh +COPY --from=builder /usr/src/app/platform/app/dist /usr/share/nginx/html +# In entrypoint.sh, app-config.js might be overwritten, so chmod it to be writeable. +# The nginx user cannot chmod it, so change to root. +USER root +RUN chmod 666 /usr/share/nginx/html/app-config.js +USER nginx +ENTRYPOINT ["/usr/src/entrypoint.sh"] +CMD ["nginx", "-g", "daemon off;"]