2023-09-28 21:36:16 +01:00
|
|
|
FROM node:20 as builder
|
2023-02-09 20:34:53 +00:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
COPY ./package*.json ./
|
2023-08-07 10:53:13 +01:00
|
|
|
COPY ./.npmrc ./
|
|
|
|
RUN npm install
|
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
|
2023-08-30 20:28:46 +01:00
|
|
|
# Currently, it does prevent a container being published with failing tests
|
2023-08-02 21:32:58 +01:00
|
|
|
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" ]
|