From d768b1e6bac34eadfd47ec64dab26ff5db104477 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 7 Jun 2025 22:59:26 +0100 Subject: [PATCH] chore: update dockerfile to run migration on start --- apps/web/Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 1105ec0a..ecdfe2c7 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -31,7 +31,7 @@ COPY . . # Generate a partial monorepo with a pruned lockfile for a target workspace. # Assuming "@acme/nextjs" is the name entered in the project's package.json: { name: "@acme/nextjs" } -RUN turbo prune --scope=${PROJECT} --docker +RUN turbo prune --scope=${PROJECT} --scope=@kan/db --docker # 3. Build the project FROM base AS builder @@ -75,5 +75,6 @@ ARG PORT=3000 ENV PORT=${PORT} EXPOSE ${PORT} -CMD ["pnpm", "start"] +# Run migration on start for now (until we have a better way to handle this) +CMD ["sh", "-c", "cd /app && pnpm db:migrate && cd /app/apps/web && pnpm start"]