Skip to content

Instantly share code, notes, and snippets.

@ccavazos
Created August 3, 2022 17:48
Show Gist options
  • Save ccavazos/b13efd198e900e362abba42bccd6f846 to your computer and use it in GitHub Desktop.
Save ccavazos/b13efd198e900e362abba42bccd6f846 to your computer and use it in GitHub Desktop.
# Builder
FROM node:14.16.0-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY yarn.lock ./
RUN yarn install --frozen-lockfile
RUN npm install react-scripts@3.4.1 -g
COPY . ./
RUN yarn build
# Runner
FROM nginx:stable-alpine as release
COPY --from=build /app/build /usr/share/nginx/html
COPY nginx/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