Last active
November 16, 2022 14:04
-
-
Save manzari/ee47a98e1a30edf2aa6d5b066f34a959 to your computer and use it in GitHub Desktop.
Dockerfile for two staged build of an react app
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
# Build | |
FROM node:alpine | |
WORKDIR /myReactApp | |
COPY package.json ./ | |
RUN npm install | |
COPY . ./ | |
RUN npm run-script build | |
# Serve | |
FROM nginx:alpine | |
COPY --from=0 /myReactApp/build /usr/share/nginx/html | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
404 when we use manual url and face a lot of error using nginx