From 8d75a80ac6c2995012428db3b9e602de93fda012 Mon Sep 17 00:00:00 2001 From: Jose Pablo Domingo Aramburo Sanchez Date: Sat, 28 Nov 2020 23:56:16 -0700 Subject: [PATCH] [add] Basic Dockerfile Still needs some work to load the favicon --- .dockerignore | 4 ++++ Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5e98512 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +node_modules +Dockerfile +dist/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec949b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Stage 1 - the build process +FROM node:12 as build-deps + +WORKDIR /usr/src/app + +COPY package.json /usr/src/app +COPY package-lock.json /usr/src/app +RUN npm install + +COPY . /usr/src/app +RUN npm run build + +# Stage 2 - the production environment +FROM nginx:1-alpine + +COPY --from=build-deps /usr/src/app/dist /usr/share/nginx/html/dist +COPY --from=build-deps /usr/src/app/index.html /usr/share/nginx/html +COPY --from=build-deps /usr/src/app/images /usr/share/nginx/html/images + +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"]