build: BuildKit cache mounts → CI 3-5× быстрее
Some checks failed
Deploy / deploy (push) Failing after 2s
Some checks failed
Deploy / deploy (push) Failing after 2s
Текущая сборка ~7 минут — npm ci качает все 183 пакета с нуля + next build без incremental cache на каждом push. - Dockerfile: BuildKit cache mount на /root/.npm (npm install) и .next/cache (Next.js incremental TS/swc/webpack cache). - workflow: DOCKER_BUILDKIT=1 чтобы cache mounts работали. - .dockerignore: убираем node_modules/.next/.git/docs из контекста — меньше копирования + чище инвалидация слоёв. - Поднимаем NODE_OPTIONS heap до 4G в build-стадии (TS падал с OOM). Первый билд после этого коммита заполнит cache — второй и дальше будут значительно быстрее (deps install ~5-10с вместо 60-90с, next build тоже ускорится за счёт incremental).
This commit is contained in:
21
.dockerignore
Normal file
21
.dockerignore
Normal file
@@ -0,0 +1,21 @@
|
||||
# Build output / зависимости — пересобираются внутри контейнера
|
||||
node_modules
|
||||
.next
|
||||
.turbo
|
||||
dist
|
||||
|
||||
# VCS / IDE
|
||||
.git
|
||||
.gitea
|
||||
.idea
|
||||
.vscode
|
||||
|
||||
# Env / секреты — на сервере есть отдельный tablet.env
|
||||
.env*
|
||||
|
||||
# Документация / временные
|
||||
*.md
|
||||
HANDOFF.md
|
||||
.DS_Store
|
||||
*.log
|
||||
tsconfig.tsbuildinfo
|
||||
Reference in New Issue
Block a user