2024-07-22 09:00:10 +02:00
|
|
|
FROM node:lts-alpine AS build
|
2024-07-22 08:52:50 +02:00
|
|
|
WORKDIR /app
|
2024-07-22 09:23:21 +02:00
|
|
|
COPY package*.json ./
|
2024-07-22 09:28:41 +02:00
|
|
|
RUN npm i
|
2024-07-22 09:23:21 +02:00
|
|
|
COPY . .
|
2024-07-22 08:52:50 +02:00
|
|
|
RUN npm run build
|
2024-07-22 09:00:10 +02:00
|
|
|
|
|
|
|
FROM node:lts-alpine AS runtime
|
2024-07-22 09:28:41 +02:00
|
|
|
USER node
|
2024-07-22 09:00:10 +02:00
|
|
|
WORKDIR /app
|
2024-07-22 09:17:33 +02:00
|
|
|
ENV NODE_ENV production
|
2024-07-22 09:25:14 +02:00
|
|
|
COPY --chown=node:node package*.json ./
|
2024-07-22 09:20:57 +02:00
|
|
|
RUN npm ci --omit=dev
|
2024-07-22 09:25:14 +02:00
|
|
|
COPY --from=build --chown=node:node /app/dist ./dist
|
2024-07-22 08:52:50 +02:00
|
|
|
EXPOSE 3000
|
2024-07-22 09:17:33 +02:00
|
|
|
CMD ["node", "./dist/index.js"]
|