fix: Docker build errors — Prisma generate order, .dockerignore multi-service
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 11s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 23s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 10s
E2E Tests / Playwright E2E (push) Failing after 12s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
Some checks failed
CI / Lint → Typecheck → Test → Build (22) (push) Failing after 11s
CI / E2E Tests (push) Has been skipped
Deploy / Build API Image (push) Failing after 23s
Deploy / Build Web Image (push) Failing after 12s
Deploy / Build AI Services Image (push) Failing after 10s
E2E Tests / Playwright E2E (push) Failing after 12s
Deploy / Deploy to Staging (push) Has been skipped
Deploy / Smoke Test Staging (push) Has been skipped
Deploy / Deploy to Production (push) Has been skipped
Deploy / Smoke Test Production (push) Has been skipped
Deploy / Rollback Staging (push) Has been skipped
Deploy / Rollback Production (push) Has been skipped
- Dockerfile: move prisma generate BEFORE nest build (fixes TS2305 PropertyType) - .dockerignore: remove apps/web + libs/ai-services exclusions (needed by Kaniko) - CI: add pnpm db:generate step before lint/typecheck/build Co-Authored-By: Claude Opus 4 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,19 @@
|
|||||||
|
# =============================================================================
|
||||||
|
# .dockerignore — shared across ALL Dockerfiles (api, web, ai-services)
|
||||||
|
# All 3 Dockerfiles build from repo root context, so do NOT exclude
|
||||||
|
# apps/web or libs/ai-services here.
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
# Build outputs & caches (rebuilt inside Docker)
|
||||||
node_modules
|
node_modules
|
||||||
.next
|
.next
|
||||||
dist
|
dist
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
.turbo
|
||||||
|
.cache
|
||||||
|
.nx
|
||||||
|
.eslintcache
|
||||||
|
coverage
|
||||||
|
|
||||||
# Version control
|
# Version control
|
||||||
.git
|
.git
|
||||||
@@ -9,15 +21,21 @@ dist
|
|||||||
.husky
|
.husky
|
||||||
.gitignore
|
.gitignore
|
||||||
|
|
||||||
# Documentation and tests
|
# Documentation, tests, monitoring (not needed in any build)
|
||||||
docs
|
docs
|
||||||
e2e
|
e2e
|
||||||
|
load-tests
|
||||||
|
monitoring
|
||||||
playwright-report
|
playwright-report
|
||||||
*.md
|
playwright.config.ts
|
||||||
!README.md
|
CHANGELOG.md
|
||||||
|
CONTRIBUTING.md
|
||||||
|
SEED_GENERATION_SCRIPT.ts
|
||||||
|
|
||||||
# Environment and secrets
|
# Environment and secrets (NEVER ship into images)
|
||||||
.env*
|
.env
|
||||||
|
.env.ci
|
||||||
|
.env.test
|
||||||
!.env.example
|
!.env.example
|
||||||
|
|
||||||
# IDE and editor
|
# IDE and editor
|
||||||
@@ -26,35 +44,24 @@ playwright-report
|
|||||||
*.swp
|
*.swp
|
||||||
*.swo
|
*.swo
|
||||||
|
|
||||||
# Build caches
|
|
||||||
.eslintcache
|
|
||||||
coverage
|
|
||||||
.turbo
|
|
||||||
.cache
|
|
||||||
.nx
|
|
||||||
|
|
||||||
# OS files
|
# OS files
|
||||||
.DS_Store
|
.DS_Store
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
# Docker files (avoid recursive context)
|
# Docker / infra files (avoid recursive context)
|
||||||
docker-compose*.yml
|
docker-compose*.yml
|
||||||
Dockerfile*
|
Dockerfile*
|
||||||
monitoring
|
infra
|
||||||
|
|
||||||
# Dev tools
|
# Dev tools & scripts (not needed at build time)
|
||||||
scripts/backup
|
scripts
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
# Python / AI services (not needed for API build)
|
# Python caches (rebuilt inside AI container)
|
||||||
libs/ai-services
|
|
||||||
__pycache__
|
__pycache__
|
||||||
*.pyc
|
*.pyc
|
||||||
.venv
|
.venv
|
||||||
|
|
||||||
# Frontend (not needed for API build, has its own Dockerfile)
|
# Agent / Claude configs
|
||||||
apps/web
|
|
||||||
|
|
||||||
# Agent configs (Paperclip / Claude)
|
|
||||||
.claude
|
.claude
|
||||||
agents
|
agents
|
||||||
|
|||||||
3
.github/workflows/ci.yml
vendored
3
.github/workflows/ci.yml
vendored
@@ -55,6 +55,9 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: pnpm install --frozen-lockfile
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Generate Prisma client
|
||||||
|
run: pnpm db:generate
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: pnpm lint
|
run: pnpm lint
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,8 @@ COPY prisma/ prisma/
|
|||||||
RUN pnpm install --frozen-lockfile --filter @goodgo/api...
|
RUN pnpm install --frozen-lockfile --filter @goodgo/api...
|
||||||
|
|
||||||
# ---- Build ----
|
# ---- Build ----
|
||||||
# Compile TypeScript for mcp-servers lib (workspace dep), then the NestJS API,
|
# Generate Prisma client first (TS types needed at compile time),
|
||||||
# then generate the Prisma client.
|
# then compile mcp-servers lib (workspace dep), then the NestJS API.
|
||||||
FROM base AS build
|
FROM base AS build
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY --from=deps /app/apps/api/node_modules ./apps/api/node_modules
|
COPY --from=deps /app/apps/api/node_modules ./apps/api/node_modules
|
||||||
@@ -30,9 +30,9 @@ COPY prisma/ prisma/
|
|||||||
COPY libs/mcp-servers/ libs/mcp-servers/
|
COPY libs/mcp-servers/ libs/mcp-servers/
|
||||||
COPY apps/api/ apps/api/
|
COPY apps/api/ apps/api/
|
||||||
|
|
||||||
RUN pnpm --filter @goodgo/mcp-servers build 2>/dev/null || true \
|
RUN npx prisma generate \
|
||||||
&& cd apps/api && npx nest build \
|
&& (pnpm --filter @goodgo/mcp-servers build 2>/dev/null || true) \
|
||||||
&& cd /app && npx prisma generate
|
&& cd apps/api && npx nest build
|
||||||
|
|
||||||
# Use pnpm deploy to produce a flat, production-only node_modules
|
# Use pnpm deploy to produce a flat, production-only node_modules
|
||||||
# This strips devDependencies and hoists only what @goodgo/api needs.
|
# This strips devDependencies and hoists only what @goodgo/api needs.
|
||||||
|
|||||||
Reference in New Issue
Block a user