From 9e143b51e36ea7d43b956f7f5a8a425e4f7597b2 Mon Sep 17 00:00:00 2001 From: jwu-fisker Date: Thu, 7 Jan 2021 20:56:40 -0800 Subject: [PATCH] Update Docker build --- .dockerignore | 1 + Dockerfile | 12 ++++-------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.dockerignore b/.dockerignore index 54310c0..7363dc7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -22,3 +22,4 @@ **/secrets.dev.yaml **/values.dev.yaml README.md +.DS_Store \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e9a1bdc..e6aaf4d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,16 +2,12 @@ # Create image to build project FROM node:12-alpine as builder -# copy the package.json to install dependencies -COPY package.json package-lock.json ./ +WORKDIR /ota-admin-portal +COPY . . COPY .env.template ./.env # Install the dependencies and make the folder -RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui - -WORKDIR /react-ui - -COPY . . +RUN npm install # Build the project and copy the files RUN npm run build @@ -28,7 +24,7 @@ COPY ./nginx.conf /etc/nginx/nginx.conf RUN rm -rf /usr/share/nginx/html/* # Copy from the stahg 1 -COPY --from=builder /react-ui/build /usr/share/nginx/html +COPY --from=builder /ota-admin-portal/build /usr/share/nginx/html EXPOSE 80 443 8080