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:17:33 +02:00
|
|
|
RUN npm ci
|
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
|
|
|
|
WORKDIR /app
|
2024-07-22 09:17:33 +02:00
|
|
|
ENV NODE_ENV production
|
|
|
|
USER node
|
2024-07-22 09:19:49 +02:00
|
|
|
COPY package*.json ./
|
2024-07-22 09:20:57 +02:00
|
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY --from=build /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"]
|