2022-03-06 13:37:06 +04:00
|
|
|
# Stage 1 - build
|
|
|
|
FROM node:16.14.0-alpine3.15 as build
|
2020-11-23 14:09:33 +03:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
|
2022-03-05 22:57:23 +04:00
|
|
|
RUN yarn install
|
2020-11-23 14:09:33 +03:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-03-06 13:37:06 +04:00
|
|
|
RUN yarn build
|
|
|
|
|
2022-03-05 22:57:23 +04:00
|
|
|
RUN yarn compile
|
|
|
|
|
2022-03-06 13:37:06 +04:00
|
|
|
# Stage 2 - make final image
|
|
|
|
FROM node:16.14.0-alpine3.15
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
|
|
|
|
RUN yarn install --production
|
|
|
|
|
|
|
|
COPY --from=build /usr/src/app/dist ./dist
|
|
|
|
COPY --from=build /usr/src/app/public ./public
|
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
CMD ["node", "dist/bin/server.js"]
|