-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc74388
commit b680b59
Showing
2 changed files
with
42 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,26 @@ | ||
# Base image for building the application | ||
FROM node:14.17.0-alpine as build-stage | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /case-flow-web/app | ||
|
||
# Copy only the package.json and package-lock.json files to leverage Docker caching | ||
COPY package-lock.json package.json /case-flow-web/app/ | ||
|
||
# Install dependencies | ||
RUN npm install --unsafe-perm --dev | ||
|
||
# Copy the entire application code | ||
COPY . /case-flow-web/app/ | ||
COPY ./package*.json ./ | ||
RUN npm ci | ||
COPY . ./ | ||
|
||
# Build the application | ||
RUN npm run build | ||
|
||
# Intermediate stage for serving the built application | ||
FROM nginx:latest as production-stage | ||
FROM artifacts.developer.gov.bc.ca/redhat-access-docker-remote/ubi8/nginx-122 AS deployer | ||
|
||
USER default | ||
|
||
# Set the working directory inside the container | ||
WORKDIR /case-flow-web/app | ||
|
||
# Copy the built files from the previous stage to Nginx's HTML directory | ||
COPY --from=build-stage /case-flow-web/app/build /usr/share/nginx/html | ||
|
||
# Copy Nginx configuration file from the host | ||
COPY ./nginx_conf/nginx.conf /etc/nginx/nginx.conf | ||
COPY /case-flow-web/app/nginx_conf/nginx.conf /etc/nginx/nginx.conf | ||
|
||
# Command to start Nginx when the container starts | ||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters