Last active
January 21, 2019 22:50
-
-
Save Marvinified/ae245bdb4d58b1ee284750183f9f2998 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
#==================== Building Stage=======================# | |
# Create the image based on the official Node 10 image from Dockerhub | |
FROM node:10 as node | |
# Create a new directory | |
RUN mkdir -p /app | |
# Change directory so that our commands run inside this new directory | |
WORKDIR /app | |
# Copy dependency definitions | |
COPY package.json /app | |
# Install dependencies using npm | |
RUN npm install | |
# Get all the code needed to run the ap | |
COPY . /app | |
#Build the app | |
RUN npm run build | |
#==================== Setting up stage ====================# | |
# Create image based on the official nginx - Alpine image | |
FROM nginx:1.13.7-alpine | |
COPY --from=node /app/build /usr/share/nginx/html | |
# nginx.conf to configure nginx because of react routing | |
COPY ./nginx.conf /etc/nginx/conf.d/default.conf | |
EXPOSE 80 | |
CMD ["nginx", "-g", "daemon off;"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment