2023-05-13 17:10:37 +00:00
|
|
|
FROM node:lts-alpine as base
|
|
|
|
WORKDIR /base
|
2023-05-17 07:18:08 +00:00
|
|
|
COPY ./package.json .
|
2023-07-28 14:23:49 +00:00
|
|
|
RUN npm install
|
2023-05-17 07:18:08 +00:00
|
|
|
COPY . .
|
2023-05-13 17:10:37 +00:00
|
|
|
|
|
|
|
FROM base AS dev
|
|
|
|
ENV NODE_ENV=development
|
|
|
|
EXPOSE 3001
|
2023-07-28 14:23:49 +00:00
|
|
|
CMD ["npm","run", "dev"]
|
2023-05-13 17:10:37 +00:00
|
|
|
|
|
|
|
|
|
|
|
FROM base AS build
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
WORKDIR /build
|
2023-05-17 07:18:08 +00:00
|
|
|
COPY --from=base /base .
|
2023-07-28 14:23:49 +00:00
|
|
|
RUN npm run build
|
2023-05-13 17:10:37 +00:00
|
|
|
|
|
|
|
FROM build as prod
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
WORKDIR /prod
|
2023-05-17 07:18:08 +00:00
|
|
|
COPY package*.json .
|
2023-07-28 14:23:49 +00:00
|
|
|
RUN npm install --production
|
2023-06-17 10:41:31 +00:00
|
|
|
|
|
|
|
COPY --from=build /build/tsconfig.json ./tsconfig.json
|
2023-05-17 07:18:08 +00:00
|
|
|
COPY --from=build /build/dist ./dist
|
|
|
|
COPY --from=build /build/build ./build
|
2023-05-17 16:00:40 +00:00
|
|
|
EXPOSE 3000
|
2023-07-28 14:23:49 +00:00
|
|
|
CMD ["npm", "run", "serve"]
|