fix: add lightweight migrate Dockerfile target to avoid tsup build failure in CI
Some checks failed
Deploy AgentLens / deploy (push) Failing after 9s
Some checks failed
Deploy AgentLens / deploy (push) Failing after 9s
The migrate service only needs Prisma CLI to run 'prisma db push'. Previously it used the 'builder' target which runs 'npx turbo build' (including sdk-ts needing tsup), causing failures in fresh CI builds over TCP where Docker cache is unavailable. New 'migrate' target copies only node_modules and prisma schema.
This commit is contained in:
@@ -16,6 +16,10 @@ COPY . .
|
|||||||
RUN npx prisma generate --schema=packages/database/prisma/schema.prisma
|
RUN npx prisma generate --schema=packages/database/prisma/schema.prisma
|
||||||
RUN npx turbo build
|
RUN npx turbo build
|
||||||
|
|
||||||
|
FROM base AS migrate
|
||||||
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY packages/database/prisma ./packages/database/prisma
|
||||||
|
|
||||||
FROM base AS web
|
FROM base AS web
|
||||||
RUN addgroup --system --gid 1001 nodejs && \
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
adduser --system --uid 1001 nextjs
|
adduser --system --uid 1001 nextjs
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ services:
|
|||||||
migrate:
|
migrate:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
target: builder
|
target: migrate
|
||||||
command: npx prisma db push --schema=packages/database/prisma/schema.prisma --skip-generate
|
command: npx prisma db push --schema=packages/database/prisma/schema.prisma --skip-generate
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://${POSTGRES_USER:-agentlens}:${POSTGRES_PASSWORD:-agentlens}@postgres:5432/${POSTGRES_DB:-agentlens}
|
- DATABASE_URL=postgresql://${POSTGRES_USER:-agentlens}:${POSTGRES_PASSWORD:-agentlens}@postgres:5432/${POSTGRES_DB:-agentlens}
|
||||||
|
|||||||
Reference in New Issue
Block a user