tariffs/Dockerfile

37 lines
715 B
Docker
Raw Normal View History

2023-03-17 13:05:46 +00:00
FROM node:19.1-alpine as dev
2022-12-16 00:36:33 +00:00
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
2023-03-17 13:05:46 +00:00
FROM node:19.1-alpine as production
2022-12-16 00:36:33 +00:00
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
2023-03-20 19:13:39 +00:00
CMD ["yarn", "start:prod"]