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

This commit is contained in:
Ruslan Bakiev
2026-03-14 10:37:46 +07:00
parent 02e816b575
commit 1189764014
2 changed files with 35 additions and 5 deletions

25
.dockerignore Normal file
View File

@@ -0,0 +1,25 @@
.git
.gitignore
.DS_Store
*.log
node_modules
.pnpm-store
npm-debug.log*
yarn-debug.log*
yarn-error.log*
.env
.env.*
!.env.example
__pycache__
*.pyc
*.pyo
.venv
venv
.pytest_cache
.mypy_cache
coverage
.coverage
.nuxt
.output
dist
build

View File

@@ -1,9 +1,11 @@
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 prisma ./prisma
RUN npx prisma generate
@@ -12,16 +14,19 @@ COPY tsconfig.json ./
COPY src ./src
RUN npm run build
FROM node:22-alpine
FROM deps AS runtime-deps
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/node_modules/.prisma ./node_modules/.prisma
COPY --from=builder /app/node_modules/@prisma/client ./node_modules/@prisma/client
COPY --from=builder /app/dist ./dist
COPY prisma ./prisma
COPY scripts ./scripts