From b20a049a64d4c863daa31737d966038766485f6e Mon Sep 17 00:00:00 2001 From: Manuel Stahl Date: Fri, 26 Jul 2019 17:59:22 +0200 Subject: [PATCH] Add Dockerfile Change-Id: I6f60fae65f03740f26d94d9a3cc2fa2402511ca9 --- .dockerignore | 11 +++++++++++ Dockerfile | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b2a9091 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +# Exclude a bunch of stuff which can make the build context a larger than it needs to be +.git/ +tests/ +build/ +lib/ +node_modules/ +electron_app/ +karma-reports/ +.idea/ +.tmp/ +config.json* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1e264eb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Builder +FROM node:10-alpine as builder + +WORKDIR /src + +COPY . /src +RUN yarn --network-timeout=100000 install +RUN yarn build + +# Copy the config now so that we don't create another layer in the app image +#RUN cp /src/config.sample.json /src/webapp/config.json + + +# App +FROM nginx:alpine + +COPY --from=builder /src/build /app + +RUN rm -rf /usr/share/nginx/html \ + && ln -s /app /usr/share/nginx/html