ohif-viewer/dockerfile

35 lines
895 B
Plaintext
Raw Normal View History

2019-01-30 19:36:25 +01:00
# Stage 1: Build the application
# docker build -t ohif/viewer:latest .
FROM node:11.2.0-slim as builder
2019-04-24 14:00:03 +02:00
# RUN apt-get update && apt-get install -y git yarn
2019-01-30 19:36:25 +01:00
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
2019-04-24 14:00:03 +02:00
2019-01-30 19:36:25 +01:00
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 prepare
2019-04-24 14:00:03 +02:00
WORKDIR /usr/src/app/example
2019-04-26 16:00:27 +02:00
RUN yarn install
RUN yarn run prepare
2019-04-24 14:00:03 +02:00
RUN sed -i "s,http://localhost:5000,http://localhost,g" index.html
RUN sed -i 's,"routerBasename": "/","routerBasename": "/demo",g' index.html
# # Stage 2: Bundle the built application into a Docker container
# # which runs Nginx using Alpine Linux
2019-01-30 19:36:25 +01:00
FROM nginx:1.15.5-alpine
RUN rm -rf /etc/nginx/conf.d
COPY conf /etc/nginx
2019-04-24 14:00:03 +02:00
COPY --from=builder /usr/src/app/example /usr/share/nginx/html
2019-01-30 19:36:25 +01:00
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]