chore: optimize docker image build pipeline
All checks were successful
Build Docker Image / build (push) Successful in 3m57s

This commit is contained in:
Ruslan Bakiev
2026-03-14 10:38:32 +07:00
parent 0bbe245e05
commit 430cb1cff6
2 changed files with 35 additions and 5 deletions

View File

@@ -1,22 +1,27 @@
FROM node:22-alpine AS builder
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json ./
RUN npm install
COPY package.json package-lock.json ./
RUN npm ci
FROM deps AS builder
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM node:22-alpine
FROM deps AS runtime-deps
RUN npm prune --omit=dev
FROM node:22-alpine AS runtime
RUN apk add --no-cache curl jq
WORKDIR /app
COPY package.json ./
RUN npm install --omit=dev
COPY --from=runtime-deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY scripts ./scripts