Created
November 28, 2024 18:59
-
-
Save silavsale/1ece42c0c447032b41ddd4c7ff44a55c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Stage 1: Build the React app | |
FROM node:18 AS build | |
# Set working directory | |
WORKDIR /usr/src/app | |
COPY package*.json ./ | |
RUN npm install --legacy-peer-deps | |
COPY . . | |
RUN npm run build && ls -la /usr/src/app/dist | |
FROM nginx:stable-alpine | |
RUN rm -rf /usr/share/nginx/html/* | |
COPY --from=build /usr/src/app/dist /usr/share/nginx/html | |
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | |
EXPOSE 8086 | |
# Start nginx | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Vetal, you can see this is a 2 stage image build