Add dockerfile for ohif-viewer package
This commit is contained in:
parent
0804bc1177
commit
fbcc4fcf40
29
Packages-react/ohif-viewer/dockerfile
Normal file
29
Packages-react/ohif-viewer/dockerfile
Normal file
@ -0,0 +1,29 @@
|
||||
# Stage 1: Build the application
|
||||
# docker build -t ohif/viewer:latest .
|
||||
FROM node:11.2.0-slim as builder
|
||||
|
||||
RUN apt-get update && apt-get install -y git yarn
|
||||
RUN mkdir /usr/src/app
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
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
|
||||
|
||||
ADD . /usr/src/app/
|
||||
RUN yarn install
|
||||
RUN yarn run build
|
||||
WORKDIR example
|
||||
RUN yarn install
|
||||
RUN yarn run prepare
|
||||
ADD example /usr/src/app/build
|
||||
|
||||
# Stage 2: Bundle the built application into a Docker container
|
||||
# which runs Nginx using Alpine Linux
|
||||
FROM nginx:1.15.5-alpine
|
||||
RUN rm -rf /etc/nginx/conf.d
|
||||
COPY conf /etc/nginx
|
||||
COPY --from=builder /usr/src/app/build /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
@ -36,7 +36,7 @@
|
||||
<!-- Load React. -->
|
||||
<!-- Note: when deploying, replace "development.js" with "production.min.js". -->
|
||||
<script src="https://unpkg.com/react@16/umd/react.development.js" crossorigin></script>
|
||||
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js" crossorigin></script>
|
||||
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
|
||||
<!--<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>!-->
|
||||
|
||||
@ -56,15 +56,42 @@
|
||||
<!--<script src="/node_modules/ohif-viewer/dist/index.umd.js" crossorigin></script>!-->
|
||||
|
||||
<!-- Load our React component. -->
|
||||
<script>
|
||||
var props = {
|
||||
"routerBasename": "http://localhost:5000",
|
||||
"servers": {
|
||||
"dicomWeb": [{
|
||||
"name": "DCM4CHEE",
|
||||
"wadoUriRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/wado",
|
||||
"qidoRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||
"wadoRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||
"qidoSupportsIncludeField": true,
|
||||
"imageRendering": "wadors",
|
||||
"thumbnailRendering": "wadors",
|
||||
"requestOptions": {
|
||||
"requestFromBrowser": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"oidc": [{
|
||||
"authServerUrl": "https://cancer.crowds-cure.org/auth/realms/dcm4che",
|
||||
"authRedirectUri": "http://localhost:5000/callback",
|
||||
"postLogoutRedirectUri": "http://localhost:5000/logout-redirect.html",
|
||||
"clientId": "crowds-cure-cancer",
|
||||
"responseType": "id_token token",
|
||||
"scope": "email profile openid",
|
||||
"revokeAccessTokenOnSignout": true,
|
||||
"extraQueryParams": {
|
||||
"kc_idp_hint": "crowds-cure-cancer-auth0-oidc",
|
||||
"client_id": "crowds-cure-cancer"
|
||||
}
|
||||
}]
|
||||
};
|
||||
</script>
|
||||
<script>
|
||||
'use strict';
|
||||
|
||||
|
||||
var routerBasename = 'http://localhost:5000';
|
||||
var props = {
|
||||
routerBasename: routerBasename
|
||||
};
|
||||
|
||||
/*
|
||||
Example config with OIDC
|
||||
*/
|
||||
@ -72,35 +99,6 @@
|
||||
// Try going to:
|
||||
// http://localhost:5000/viewer/1.3.6.1.4.1.25403.345050719074.3824.20170126082328.1
|
||||
// http://ohif-viewer-react.s3-website-us-east-1.amazonaws.com/viewer/1.3.6.1.4.1.25403.345050719074.3824.20170126082328.1
|
||||
props.servers = {
|
||||
"dicomWeb": [{
|
||||
"name": "DCM4CHEE",
|
||||
"wadoUriRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/wado",
|
||||
"qidoRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||
"wadoRoot": "https://cancer.crowds-cure.org/dcm4chee-arc/aets/DCM4CHEE/rs",
|
||||
"qidoSupportsIncludeField": true,
|
||||
"imageRendering": "wadors",
|
||||
"thumbnailRendering": "wadors",
|
||||
"requestOptions": {
|
||||
"requestFromBrowser": true
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
props.oidc = [{
|
||||
"authServerUrl": "https://cancer.crowds-cure.org/auth/realms/dcm4che",
|
||||
"authRedirectUri": routerBasename + '/callback',
|
||||
"postLogoutRedirectUri": routerBasename + '/logout-redirect.html',
|
||||
"clientId": "crowds-cure-cancer",
|
||||
"responseType": "id_token token",
|
||||
"scope": "email profile openid",
|
||||
"revokeAccessTokenOnSignout": true,
|
||||
"extraQueryParams": {
|
||||
"kc_idp_hint": "crowds-cure-cancer-auth0-oidc",
|
||||
"client_id": "crowds-cure-cancer"
|
||||
}
|
||||
}];
|
||||
|
||||
/* Example config without OIDC */
|
||||
// Try going to:
|
||||
@ -162,9 +160,9 @@
|
||||
);
|
||||
}
|
||||
|
||||
props.whiteLabelling = {
|
||||
/*props.whiteLabelling = {
|
||||
logoComponent: RadicalImagingLogo()
|
||||
}
|
||||
}*/
|
||||
|
||||
// TODO: Why do we need to do this? Something is wrong with our rollup settings
|
||||
var Viewer = window.OHIFStandaloneViewer.App;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user