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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user