Skip to content

Commit

Permalink
Add builder Docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
compulim committed Jun 17, 2019
1 parent f47e227 commit c9a3d01
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions samples/19.a.single-sign-on-for-enterprise-apps/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Builder is based on Node.js 12 image
# This builder image will build HTML and JavaScript code out of the create-react-app project
FROM node:12 AS builder-web
WORKDIR /var/web/

# Copy the web app code to /var/web/
# We excluded /.env and /node_modules/ via .dockerignore
ADD app/ /var/web/

# Doing a fresh "npm install" on build to make sure the image is reproducible
RUN npm ci

# Build the web app code via create-react-app and react-scripts
RUN npm run build

FROM node:12

ADD bot/ /var/bot/
ADD rest-api/ /var/web/
COPY --from=builder-web /var/web/build/ /var/web/public/

WORKDIR /var/bot/
RUN npm ci

WORKDIR /var/web/
RUN npm ci

WORKDIR /var/
RUN tar -cf build.tgz bot web

ENTRYPOINT sh

0 comments on commit c9a3d01

Please sign in to comment.