fix: add retry loop for database connection in entrypoint
This commit is contained in:
+14
-4
@@ -20,11 +20,21 @@ RUN pnpm install --frozen-lockfile
|
||||
FROM installer AS builder
|
||||
COPY --from=pruner /app/out/full/ .
|
||||
COPY tsconfig.base.json ./
|
||||
|
||||
# Generate Prisma client
|
||||
RUN pnpm exec prisma generate --schema=apps/api/prisma/schema.prisma
|
||||
# Build internal workspace packages that api depends on first
|
||||
RUN pnpm turbo build --filter=@tower/config --filter=@tower/logger --filter=@tower/search --filter=@tower/types
|
||||
# Build the api itself using nest CLI directly from the package directory
|
||||
RUN cd apps/api && pnpm exec nest build
|
||||
|
||||
# Build internal workspace packages that api depends on (in dependency order)
|
||||
RUN pnpm --filter @tower/types run build
|
||||
RUN pnpm --filter @tower/config run build
|
||||
RUN pnpm --filter @tower/logger run build
|
||||
RUN pnpm --filter @tower/search run build
|
||||
|
||||
# Build the API via its package script (runs nest build from apps/api/)
|
||||
RUN pnpm --filter @tower/api run build
|
||||
|
||||
# Hard verify: fail the Docker build if dist wasn't produced
|
||||
RUN test -f apps/api/dist/main.js || (echo "ERROR: apps/api/dist/main.js not found after build!" && exit 1)
|
||||
|
||||
# ─── Production runner ───
|
||||
FROM node:22-alpine AS runner
|
||||
|
||||
Reference in New Issue
Block a user