From fbcc4fcf404e7e38a9d5babcaea15002861b1e96 Mon Sep 17 00:00:00 2001 From: Erik Ziegler Date: Wed, 30 Jan 2019 18:36:25 +0000 Subject: [PATCH] Add dockerfile for ohif-viewer package --- Packages-react/ohif-viewer/dockerfile | 29 ++++++++ Packages-react/ohif-viewer/example/index.html | 74 +++++++++---------- 2 files changed, 65 insertions(+), 38 deletions(-) create mode 100644 Packages-react/ohif-viewer/dockerfile diff --git a/Packages-react/ohif-viewer/dockerfile b/Packages-react/ohif-viewer/dockerfile new file mode 100644 index 000000000..958e6277f --- /dev/null +++ b/Packages-react/ohif-viewer/dockerfile @@ -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;"] diff --git a/Packages-react/ohif-viewer/example/index.html b/Packages-react/ohif-viewer/example/index.html index d717d7d2d..476aea37c 100644 --- a/Packages-react/ohif-viewer/example/index.html +++ b/Packages-react/ohif-viewer/example/index.html @@ -36,7 +36,7 @@ - + @@ -56,15 +56,42 @@ +