feat(deploy): auto-run db migrations + seed on stack deploy

Add a migrator Dockerfile target (drizzle-kit migrate + tier-definitions
seed, both idempotent) and wire it as a one-shot compose service that web
waits on via service_completed_successfully. No more manual exec step
after first deploy — runs safely on every redeploy.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Arnaud
2026-07-01 16:23:54 +02:00
parent 4a90ad910c
commit a4fb62c86c
3 changed files with 25 additions and 9 deletions
+6
View File
@@ -11,6 +11,12 @@ COPY packages/db/package.json packages/db/package.json
COPY packages/api-types/package.json packages/api-types/package.json
RUN pnpm install --frozen-lockfile
# ---- migrator: applies drizzle migrations + seeds tier definitions ----
FROM deps AS migrator
WORKDIR /repo/packages/db
COPY packages/db .
CMD ["sh", "-c", "pnpm migrate && pnpm seed"]
# ---- build ----
FROM base AS build
WORKDIR /repo