tariffs/Dockerfile
2023-03-20 22:13:39 +03:00

37 lines
715 B
Docker

FROM node:19.1-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:19.1-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 ["yarn", "start:prod"]