Skip to content

Commit

Permalink
fix wrong bulkDataUri
Browse files Browse the repository at this point in the history
  • Loading branch information
amazy committed Jun 26, 2024
1 parent 3064aed commit 5af834d
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 2 deletions.
12 changes: 12 additions & 0 deletions docker/ohif-test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
12 changes: 10 additions & 2 deletions docker/ohif-test/ohif-v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
41 changes: 41 additions & 0 deletions docker/ohif-test/ohif/Dockerfile
Original file line number Diff line number Diff line change
@@ -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;"]

0 comments on commit 5af834d

Please sign in to comment.