Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
sakthi-aot committed Mar 19, 2024
1 parent 5ebb3d0 commit ae04a9e
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 24 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/caseflow_web_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: "./app/caseflow_web/package-lock.json"
- run: npm install --force
working-directory: ./app/caseflow_web
- run: CI=false npm run build
working-directory: ./app/caseflow_web
# - run: npm install --force
# working-directory: ./app/caseflow_web
# - run: CI=false npm run build
# working-directory: ./app/caseflow_web


- name: Set ENV variables
Expand Down
42 changes: 22 additions & 20 deletions app/caseflow_web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
# base image
FROM node:14.17.0-alpine as build-stage
# "build-stage", based on Node.js, to build and compile the frontend
# pull official base image
FROM node:14-alpine as build-stage

# add `/app/node_modules/.bin` to $PATH
ENV PATH /node_modules/.bin:$PATH
# set working directory
WORKDIR /app

RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH

# install and cache app dependencies
COPY ./package*.json ./
RUN npm ci
COPY . ./
# install app dependencies
COPY package.json ./
COPY package-lock.json ./

RUN npm run build
RUN npm install --silent
RUN npm install react-scripts@3.4.1 -g --silent

FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nginx-122 AS deployer
# create and set user permissions to app folder
RUN mkdir -p node_modules/.cache && chmod -R 777 node_modules/.cache

USER default

# Copy the app built on build-stage to the resulting container.
COPY --from=build-stage /opt/app-root/src/dist .
# add app files
COPY . ./

# Copy the default.conf to /etc/nginx/conf.d
COPY --from=builder /opt/app-root/src/default.conf /etc/nginx/conf.d
RUN npm run build

COPY ./nginx.conf /etc/nginx/nginx.conf
# Start nginx with the appropriate command
# Stage 1, based on Nginx, to have only the compiled app, ready for production with Nginx
FROM nginx:1.17 as production-stage
RUN mkdir /app
COPY --from=build-stage /app/build /usr/share/nginx/html
COPY nginx.conf /etc/nginx/nginx.conf
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit ae04a9e

Please sign in to comment.