2023-07-28 20:51:43 +01:00
|
|
|
FROM node:20 as builder
|
2023-02-09 20:34:53 +00:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY ./package*.json ./
|
2023-07-28 20:51:43 +01:00
|
|
|
RUN npm i
|
2023-02-09 20:34:53 +00:00
|
|
|
COPY . .
|
2023-08-02 21:32:58 +01:00
|
|
|
# Ideally the tests should be run separately in a CI/CD workflow rather than during the build
|
|
|
|
RUN npm run test
|
2023-07-28 20:51:43 +01:00
|
|
|
RUN npm run build
|
|
|
|
|
|
|
|
FROM node:20-slim
|
|
|
|
EXPOSE 8460
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY ./mail-templates/* ./mail-templates/
|
|
|
|
COPY ./package*.json ./
|
|
|
|
RUN npm ci --omit=dev
|
|
|
|
COPY --from=builder /usr/src/app/dist/ ./
|
|
|
|
CMD [ "node" , "app.js" ]
|