tariffs/Dockerfile
2022-12-16 03:36:33 +03:00

37 lines
709 B
Docker

FROM node:16-alpine as dev
RUN apk update && rm -rf /var/cache/apk/*
WORKDIR /usr/app
# Install node dependencies - done in a separate step so Docker can cache it.
COPY yarn.lock .
COPY package.json .
COPY tsconfig.json .
RUN yarn install --ignore-scripts --non-interactive --frozen-lockfile && yarn cache clean
COPY . .
RUN ls
RUN yarn build
FROM node:16-alpine as production
RUN apk update && rm -rf /var/cache/apk/*
WORKDIR /app
COPY --from=dev /usr/app/dist /app
COPY --from=dev /usr/app/package.json /app/
COPY --from=dev /usr/app/yarn.lock /app/
RUN chown -R node: .
USER node
RUN yarn install --non-interactive --frozen-lockfile --production && yarn cache clean
CMD ["node", "index.js"]