ohif-viewer/docker/OpenResty-Orthanc-Keycloak/dockerfile

67 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-05-06 20:11:40 +02:00
# docker-compose
# --------------
# This dockerfile is used by the `docker-compose.yml` adjacent file. When
# running `docker-compose build`, this dockerfile helps build the "webapp" image.
# All paths are relative to the `context`, which is the project root directory.
2019-05-04 03:21:42 +02:00
#
2019-05-06 20:11:40 +02:00
# docker build
# --------------
# If you would like to use this dockerfile to build and tag an image, make sure
# you set the context to the project's root directory:
# https://docs.docker.com/engine/reference/commandline/build/
2019-05-04 03:21:42 +02:00
#
2019-05-06 20:11:40 +02:00
#
# SUMMARY
# --------------
# This dockerfile has two stages:
#
# 1. Building the React application for production
# 2. Setting up our Nginx (OpenResty*) image w/ step one's output
#
# * OpenResty is functionally identical to Nginx with the addition of Lua out of
2019-05-04 03:21:42 +02:00
# the box.
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
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
ENV REACT_APP_CONFIG=config/example_openidc.js
2019-01-30 19:36:25 +01:00
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 build:web
2019-04-24 14:00:03 +02:00
# Stage 2: Bundle the built application into a Docker container
# which runs openresty (nginx) using Alpine Linux
2019-05-07 18:28:53 +02:00
# LINK: https://hub.docker.com/r/openresty/openresty
FROM openresty/openresty:1.15.8.1rc1-0-alpine-fat
RUN mkdir /var/log/nginx
RUN apk add --no-cache openssl
RUN apk add --no-cache openssl-dev
RUN apk add --no-cache git
RUN apk add --no-cache gcc
2019-05-07 18:29:34 +02:00
# !!!
RUN luarocks install lua-resty-openidc
2019-05-07 18:29:34 +02:00
#
RUN luarocks install lua-resty-jwt
RUN luarocks install lua-resty-session
RUN luarocks install lua-resty-http
2019-05-07 18:29:34 +02:00
# !!!
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
ENTRYPOINT ["/usr/local/openresty/nginx/sbin/nginx", "-g", "daemon off;"]