2024-10-31 19:17:58 +01:00
|
|
|
FROM node:lts-slim
|
2024-10-30 17:24:34 +01:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2024-11-03 11:22:38 +01:00
|
|
|
COPY app/ ./
|
2024-11-01 08:55:54 +01:00
|
|
|
|
2024-11-02 22:18:04 +01:00
|
|
|
RUN npm install pm2 -g
|
2024-10-30 17:24:34 +01:00
|
|
|
|
2024-11-03 11:22:38 +01:00
|
|
|
RUN chown -R node:node /app
|
|
|
|
|
|
|
|
USER node
|
|
|
|
|
|
|
|
RUN npm install --omit=dev
|
2024-10-30 17:24:34 +01:00
|
|
|
|
2024-11-03 15:19:12 +01:00
|
|
|
ARG PACKAGE_VERSION
|
|
|
|
ENV APP_VERSION=${PACKAGE_VERSION}
|
2024-11-01 19:02:31 +01:00
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
2024-11-01 08:55:54 +01:00
|
|
|
# Build without type checking, as we have removed the Typescript
|
|
|
|
# dev-dependencies above to save space in the final build
|
|
|
|
RUN npx tsc --noCheck
|
2024-10-30 17:24:34 +01:00
|
|
|
|
2024-11-02 23:13:32 +01:00
|
|
|
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD node /app/healthcheck.js || exit 1
|
|
|
|
|
2024-11-02 22:18:04 +01:00
|
|
|
CMD ["pm2-runtime", "dist/index.js" ]
|