Update Docker build

This commit is contained in:
jwu-fisker
2021-01-07 20:56:40 -08:00
parent f52dc47549
commit 9e143b51e3
2 changed files with 5 additions and 8 deletions

View File

@@ -22,3 +22,4 @@
**/secrets.dev.yaml **/secrets.dev.yaml
**/values.dev.yaml **/values.dev.yaml
README.md README.md
.DS_Store

View File

@@ -2,16 +2,12 @@
# Create image to build project # Create image to build project
FROM node:12-alpine as builder FROM node:12-alpine as builder
# copy the package.json to install dependencies WORKDIR /ota-admin-portal
COPY package.json package-lock.json ./ COPY . .
COPY .env.template ./.env COPY .env.template ./.env
# Install the dependencies and make the folder # Install the dependencies and make the folder
RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui RUN npm install
WORKDIR /react-ui
COPY . .
# Build the project and copy the files # Build the project and copy the files
RUN npm run build RUN npm run build
@@ -28,7 +24,7 @@ COPY ./nginx.conf /etc/nginx/nginx.conf
RUN rm -rf /usr/share/nginx/html/* RUN rm -rf /usr/share/nginx/html/*
# Copy from the stahg 1 # 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 EXPOSE 80 443 8080