"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"build:staging": "env-cmd -f .env.staging react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
FROM node:18-alpine as base
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
COPY package.json yarn.lock /app/
RUN yarn install
COPY . /app
FROM base as dev-server
EXPOSE 80
CMD ["yarn", "start"]
FROM base as build
ARG MODE
RUN yarn run build --mode $MODE
FROM nginx:1.16.0-alpine as static-server
COPY --from=build /app/build /app/build
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]