Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nginx archive recipe): Fixes to various configuration files. #3624

Merged
merged 3 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Reduces size of context and hides
# files from Docker (can't COPY or ADD these)

# Note that typically the Docker context for various OHIF containers is the
# directory of this file (i.e. the root of the source). As such, this is
# the .dockerignore file for ALL Docker containers that are built. For example,
# the Docker containers built from the recipes in ./platform/app/.recipes will
# have this file as their .dockerignore.

# Output
dist/
build/
Expand Down Expand Up @@ -28,3 +34,4 @@ dockerfile
.vscode/
coverage/
docs/
testdata/
16 changes: 0 additions & 16 deletions platform/app/.recipes/OpenResty-Orthanc-Keycloak/.dockerignore

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ services:
ohif_viewer:
build:
# Project root
context: ./../../
context: ./../../../../
# Relative to context
dockerfile: ./docker/OpenResty-Orthanc-Keycloak/dockerfile
dockerfile: ./platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile
image: webapp:latest
container_name: webapp
volumes:
Expand All @@ -35,7 +35,7 @@ services:
# TODO: Update to use Postgres
# https://github.com/mrts/docker-postgresql-multiple-databases
orthanc:
image: jodogne/orthanc-plugins:1.5.6
image: jodogne/orthanc-plugins
hostname: orthanc
container_name: orthanc
volumes:
Expand Down
13 changes: 8 additions & 5 deletions platform/app/.recipes/OpenResty-Orthanc-Keycloak/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,23 @@


# Stage 1: Build the application
FROM node:11.2.0-slim as builder
FROM node:16.15.0-slim as builder

RUN mkdir /usr/src/app
WORKDIR /usr/src/app

ENV APP_CONFIG=config/docker_openresty-orthanc-keycloak.js
ENV PATH /usr/src/app/node_modules/.bin:$PATH

COPY package.json /usr/src/app/package.json
COPY yarn.lock /usr/src/app/yarn.lock
# Copy all files from the root of the OHIF source and note
# that the Docker ignore file at the root (i.e. ./dockerignore) will filter
# out files and directories that are not needed.
COPY ./ /usr/src/app/

ADD . /usr/src/app/
RUN yarn config set workspaces-experimental true
RUN yarn install
RUN yarn run build:web
RUN yarn run build

# Stage 2: Bundle the built application into a Docker container
# which runs openresty (nginx) using Alpine Linux
Expand All @@ -60,6 +63,6 @@ RUN luarocks install lua-resty-openidc
RUN luarocks install luacrypto

# Copy build output to image
COPY --from=builder /usr/src/app/build /var/www/html
COPY --from=builder /usr/src/app/platform/app/dist /var/www/html

ENTRYPOINT ["/usr/local/openresty/nginx/sbin/nginx", "-g", "daemon off;"]
16 changes: 0 additions & 16 deletions platform/app/.recipes/OpenResty-Orthanc/.dockerignore

This file was deleted.

2 changes: 2 additions & 0 deletions platform/app/.recipes/OpenResty-Orthanc/config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ http {
index index.html;
try_files $uri $uri/ /index.html;
add_header Cache-Control "no-store, no-cache, must-revalidate";
add_header 'Cross-Origin-Opener-Policy' 'same-origin' always;
add_header 'Cross-Origin-Embedder-Policy' 'require-corp' always;
}

# EXAMPLE: Redirect server error pages to the static page /40x.html
Expand Down
2 changes: 1 addition & 1 deletion platform/app/.recipes/OpenResty-Orthanc/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
# TODO: Update to use Postgres
# https://github.com/mrts/docker-postgresql-multiple-databases
orthanc:
image: jodogne/orthanc-plugins:1.5.6
image: jodogne/orthanc-plugins
hostname: orthanc
container_name: orthanc
volumes:
Expand Down
23 changes: 9 additions & 14 deletions platform/app/.recipes/OpenResty-Orthanc/dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,19 @@


# Stage 1: Build the application
FROM node:12.22.1-slim as builder
FROM node:16.15.0-slim as builder

RUN mkdir /usr/src/app
WORKDIR /usr/src/app

# Copy Files
COPY .docker /usr/src/app/.docker
COPY .webpack /usr/src/app/.webpack
COPY extensions /usr/src/app/extensions
COPY modes /usr/src/app/modes
COPY platform /usr/src/app/platform
COPY .browserslistrc /usr/src/app/.browserslistrc
COPY aliases.config.js /usr/src/app/aliases.config.js
COPY babel.config.js /usr/src/app/babel.config.js
COPY lerna.json /usr/src/app/lerna.json
COPY package.json /usr/src/app/package.json
COPY postcss.config.js /usr/src/app/postcss.config.js
COPY yarn.lock /usr/src/app/yarn.lock
# Copy all files from the root of the OHIF source and note
# that the Docker ignore file at the root (i.e. ./dockerignore) will filter
# out files and directories that are not needed.
COPY ./ /usr/src/app/

# For arm builds since parcel doesn't have prebuilt binaries for arm yet
RUN apt-get update && apt-get install -y build-essential python3


# ADD . /usr/src/app/
RUN yarn config set workspaces-experimental true
Expand Down
37 changes: 22 additions & 15 deletions platform/app/public/config/docker_openresty-orthanc-keycloak.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
window.config = {
routerBasename: '/',
showStudyList: true,
extensions: [],
modes: [],
// below flag is for performance reasons, but it might not work for all servers

showWarningMessageForCrossOrigin: true,
showCPUFallbackMessage: true,
showLoadingIndicator: true,
strictZSpacingForVolumeViewport: true,
servers: {
// This is an array, but we'll only use the first entry for now
dicomWeb: [
{
defaultDataSourceName: 'dicomweb',
dataSources: [
{
namespace: '@ohif/extension-default.dataSourcesModule.dicomweb',
sourceName: 'dicomweb',
configuration: {
friendlyName: 'Orthanc Server',
name: 'Orthanc',
wadoUriRoot: 'http://127.0.0.1/pacs/wado',
wadoUriRoot: 'http://127.0.0.1/pacs/dicom-web',
qidoRoot: 'http://127.0.0.1/pacs/dicom-web',
wadoRoot: 'http://127.0.0.1/pacs/dicom-web',
qidoSupportsIncludeField: false,
qidoSupportsIncludeField: true,
supportsReject: true,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
omitQuotationForMultipartRequest: true,
// REQUIRED TAG:
// TODO: Remove tag after https://github.com/OHIF/ohif-core/pull/19 is merged and we bump version
// requestOptions: {
// undefined to use JWT + Bearer auth
// auth: 'orthanc:orthanc',
// },
enableStudyLazyLoad: true,
supportsFuzzyMatching: true,
supportsWildcard: true,
dicomUploadEnabled: true,
bulkDataURI: {
enabled: true,
},
},
],
},
},
],
// This is an array, but we'll only use the first entry for now
oidc: [
{
Expand Down
13 changes: 10 additions & 3 deletions platform/app/public/config/docker_openresty-orthanc.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ window.config = {
configuration: {
friendlyName: 'Orthanc Server',
name: 'Orthanc',
wadoUriRoot: 'http://127.0.0.1/pacs/wado',
wadoUriRoot: 'http://127.0.0.1/pacs/dicom-web',
qidoRoot: 'http://127.0.0.1/pacs/dicom-web',
wadoRoot: 'http://127.0.0.1/pacs/dicom-web',
qidoSupportsIncludeField: false,
qidoSupportsIncludeField: true,
supportsReject: true,
imageRendering: 'wadors',
thumbnailRendering: 'wadors',
omitQuotationForMultipartRequest: true,
enableStudyLazyLoad: true,
supportsFuzzyMatching: true,
supportsWildcard: true,
dicomUploadEnabled: true,
bulkDataURI: {
enabled: true,
},
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion platform/docs/docs/deployment/nginx--image-archive.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ in command prompt or terminal_

### Setup

- Navigate to `viewer` folder inside `platform`
- Navigate to `app` folder inside `platform`
- then: `cd .recipes/OpenResty-Orthanc`
- run: `docker-compose up --build`
- Navigate to `127.0.0.1` for the viewer
Expand Down