From ffa2dd6f5497f99695b9e0ce3541246681a5fedb Mon Sep 17 00:00:00 2001 From: Rushil Umaretiya Date: Sun, 31 Jan 2021 11:54:37 -0500 Subject: [PATCH] feat(frontend): dockerized frontend --- frontend/.dockerignore | 2 ++ frontend/Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 frontend/.dockerignore create mode 100644 frontend/Dockerfile diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..2ca0b18 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,22 @@ +## Build React App ## + +FROM node:14.15.4-buster as builder + +WORKDIR /app + +COPY package*.json ./ + +RUN npm install --silent + +RUN npm install react-scripts -g --silent + +COPY . . + +RUN npm run build + +## Run w/ Nginx ## +FROM nginx:alpine + +COPY --from=builder /app/build /usr/share/nginx/html + +EXPOSE 80