Reduce docker container size by ~100MB
All checks were successful
Build and Push Container / build (push) Successful in 1m1s

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"]

View File

@ -16,15 +16,17 @@
"license": "MIT",
"packageManager": "pnpm@10.7.1",
"dependencies": {
"axios": "1.8.4",
"lodash-es": "4.17.21"
},
"devDependencies": {
"@types/lodash-es": "4.17.12",
"@types/node": "22.14.1",
"axios": "1.8.4",
"esbuild": "0.25.2",
"@typescript-eslint/eslint-plugin": "7.2.0",
"@typescript-eslint/parser": "7.2.0",
"eslint": "8.57.0",
"eslint-config-prettier": "9.1.0",
"lodash-es": "4.17.21",
"prettier": "3.5.3",
"typescript": "5.8.3"
},

View File

@ -8,6 +8,13 @@ importers:
.:
dependencies:
axios:
specifier: 1.8.4
version: 1.8.4
lodash-es:
specifier: 4.17.21
version: 4.17.21
devDependencies:
'@types/lodash-es':
specifier: 4.17.12
version: 4.17.12
@ -20,9 +27,6 @@ importers:
'@typescript-eslint/parser':
specifier: 7.2.0
version: 7.2.0(eslint@8.57.0)(typescript@5.8.3)
axios:
specifier: 1.8.4
version: 1.8.4
esbuild:
specifier: 0.25.2
version: 0.25.2
@ -32,9 +36,6 @@ importers:
eslint-config-prettier:
specifier: 9.1.0
version: 9.1.0(eslint@8.57.0)
lodash-es:
specifier: 4.17.21
version: 4.17.21
prettier:
specifier: 3.5.3
version: 3.5.3