diff --git a/Dockerfile b/Dockerfile index 48139a5..cb37973 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM node:20-alpine -WORKDIR /app +FROM node:22-alpine AS build +WORKDIR /build RUN apk add python3 make g++ && \ corepack enable && \ @@ -8,7 +8,14 @@ RUN apk add python3 make g++ && \ COPY package*.json pnpm*.yaml tsconfig.json ./ RUN pnpm install --frozen-lockfile -COPY src /app/src +COPY src ./src RUN pnpm run build +RUN pnpm prune --prod -CMD [ "node", "/app/dist/main.js" ] +FROM node:22-alpine +WORKDIR /app +COPY --from=build /build/package*.json ./ +COPY --from=build /build/dist ./dist +COPY --from=build /build/node_modules ./node_modules + +ENTRYPOINT [ "docker-entrypoint.sh", "node", "/app/dist/main.js" ] diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8a24b92..5f1d1ef 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,12 +14,6 @@ importers: '@mtcute/node': specifier: ^0.22.3 version: 0.22.3 - '@types/command-line-args': - specifier: ^5.2.3 - version: 5.2.3 - '@types/js-yaml': - specifier: ^4.0.9 - version: 4.0.9 command-line-args: specifier: ^6.0.1 version: 6.0.1 @@ -36,6 +30,12 @@ importers: '@antfu/eslint-config': specifier: ^4.11.0 version: 4.11.0(@typescript-eslint/utils@8.29.0(eslint@9.24.0)(typescript@5.8.3))(@vue/compiler-sfc@3.5.13)(eslint@9.24.0)(typescript@5.8.3) + '@types/command-line-args': + specifier: ^5.2.3 + version: 5.2.3 + '@types/js-yaml': + specifier: ^4.0.9 + version: 4.0.9 '@types/node': specifier: ^22.14.0 version: 22.14.0