<gh_stars>0
## Stage 1 - Lets build the "deployable package"
#FROM node:7.10 as frontend-build
FROM node:14-buster-slim as frontend-build
WORKDIR /fullstack/frontend

# Step 1 - Download all package dependencies first.
# We will redownload dependencies only when packages change.
COPY package.json package-lock.json ./
RUN npm install

# Step 2 - Copy all source and run build
COPY . ./
RUN npm run build

## Stage 2 - Let's build a minimal image with the "deployable package"
#FROM nginx:1.12-alpine
FROM nginx:1.19.3
COPY --from=frontend-build /fullstack/frontend/build /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]