2022-06-14 13:06:42 +03:00
|
|
|
FROM node:16-alpine as dev
|
|
|
|
|
|
|
|
ENV NODE_ENV=development
|
|
|
|
|
|
|
|
WORKDIR /usr/app
|
|
|
|
|
|
|
|
COPY yarn.lock .
|
|
|
|
COPY package.json .
|
2022-06-29 13:02:30 +03:00
|
|
|
RUN apk update && apk add --no-cache g++ make python3 git openssh && rm -rf /var/cache/apk/*
|
2022-07-01 12:36:22 +03:00
|
|
|
RUN yarn install
|
2022-06-29 13:02:30 +03:00
|
|
|
COPY . ./
|
2019-07-18 16:22:56 +03:00
|
|
|
|
2022-06-14 13:06:42 +03:00
|
|
|
RUN yarn build
|
|
|
|
|
2022-06-29 13:02:30 +03:00
|
|
|
FROM node:16-alpine as prod
|
2022-06-14 13:06:42 +03:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2022-06-29 13:02:30 +03:00
|
|
|
RUN apk update && apk add --no-cache g++ make python3 git openssh && rm -rf /var/cache/apk/*
|
|
|
|
|
2022-06-14 13:06:42 +03:00
|
|
|
COPY --from=dev /usr/app/build /app
|
|
|
|
COPY --from=dev /usr/app/package.json /app/
|
|
|
|
COPY --from=dev /usr/app/yarn.lock /app/
|
|
|
|
|
2022-06-29 13:02:30 +03:00
|
|
|
RUN yarn install && yarn cache clean -f
|
2022-06-14 13:06:42 +03:00
|
|
|
|