Reduce docker container size by ~100MB

This commit is contained in:
pfych 2025-04-30 19:24:18 +10:00
parent 9dfc790200
commit 040b427d97
3 changed files with 22 additions and 14 deletions

View file

@ -1,4 +1,4 @@
FROM node:20-alpine
FROM node:20-alpine AS base
WORKDIR /checker
@ -6,12 +6,17 @@ COPY package.json ./
COPY pnpm-lock.yaml ./
COPY src ./src
LABEL org.opencontainers.image.source=https://git.pfy.ch/pfych/chapter-tracker
LABEL org.opencontainers.image.description="Ping a webhook when a new MangaDex chapter is released"
LABEL org.opencontainers.image.licenses=MIT
RUN npm install -g pnpm
RUN pnpm install
RUN pnpm run compile
CMD ["node", "./.out/build.js"]
FROM node:20-alpine AS app
LABEL org.opencontainers.image.source=https://git.pfy.ch/pfych/chapter-tracker
LABEL org.opencontainers.image.description="Ping a webhook when a new MangaDex chapter is released"
LABEL org.opencontainers.image.licenses=MIT
WORKDIR /checker
COPY --from=base /checker/.out/build.js build.js
CMD ["node", "build.js"]