Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
react-openshift/Dockerfile
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
15 lines (14 sloc)
432 Bytes
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
# Step 1: Build the React application | |
FROM node:20 AS build | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install | |
COPY . . | |
RUN npm run build | |
# Step 2: Serve the app using NGINX | |
FROM nginxinc/nginx-unprivileged:mainline | |
COPY ./nginx/default.conf /etc/nginx/conf.d/default.conf | |
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf | |
COPY --from=build /usr/src/app/dist /usr/share/nginx/html | |
EXPOSE 8080 | |
CMD ["nginx", "-g", "daemon off;"] |