Last active
February 18, 2020 09:22
-
-
Save MnifR/21ea68765072f274f6d2306c31e6e2c8 to your computer and use it in GitHub Desktop.
Dockerfile
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
# stage1 as builder | |
FROM node:lts-alpine as builder | |
# copy the package.json to install dependencies | |
COPY package.json package-lock.json ./ | |
# Install the dependencies and make the folder | |
RUN npm install && mkdir /react-ui && mv ./node_modules ./react-ui | |
WORKDIR /react-ui | |
COPY . . | |
# Build the project and copy the files | |
RUN npm run build | |
FROM nginx:alpine | |
#!/bin/sh | |
COPY ./.nginx/nginx.conf /etc/nginx/nginx.conf | |
## Remove default nginx index page | |
RUN rm -rf /usr/share/nginx/html/* | |
# Copy from the stahg 1 | |
COPY --from=builder /react-ui/build /usr/share/nginx/html | |
EXPOSE 3000 80 | |
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment