From 8bdab69288f89a7b50e359557048a403578cd84c Mon Sep 17 00:00:00 2001 From: Chris Farhood Date: Fri, 22 May 2026 13:30:44 +0000 Subject: [PATCH] revert: undo PR #47 Dockerfile apps/api switch (broke CI Docker build) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts the Dockerfile to the root src/ build. PR #47 switched to apps/api/ but the pnpm workspace config and lockfile don't include apps/*, causing Docker build failures (CI runs #968, #970). The actual admin 500 root cause needs further investigation — it's in the code/schema changes, not the Dockerfile build path. Co-Authored-By: Paperclip --- Dockerfile | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index 17923b2..ac523cc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,14 +5,19 @@ WORKDIR /app # Install deps FROM base AS deps COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./ -COPY apps/api/package.json apps/api/ +COPY packages/db/package.json packages/db/ +COPY packages/types/package.json packages/types/ RUN pnpm install --frozen-lockfile # Build FROM deps AS builder RUN mkdir -p /home/node/.cache/node/corepack -COPY apps/api/ apps/api/ -RUN pnpm --filter @groombook/api build +COPY packages/ packages/ +COPY src/ src/ +COPY tsconfig.json ./ +RUN pnpm --filter @groombook/types build && \ + pnpm --filter @groombook/db build && \ + pnpm build # Runtime FROM node:22-alpine AS runner @@ -20,22 +25,29 @@ RUN corepack enable && corepack prepare pnpm@9.15.4 --activate WORKDIR /app ENV NODE_ENV=production -COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ -COPY --from=builder /app/apps/api/package.json apps/api/ -COPY --from=builder /app/apps/api/dist apps/api/dist +COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./ +COPY --from=builder /app/package.json ./ +COPY --from=builder /app/dist dist/ +COPY --from=builder /app/packages/db/package.json packages/db/ +COPY --from=builder /app/packages/db/dist packages/db/dist +COPY --from=builder /app/packages/types/package.json packages/types/ +COPY --from=builder /app/packages/types/dist packages/types/dist RUN pnpm install --frozen-lockfile --prod EXPOSE 3000 RUN apk add --no-cache curl HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ CMD curl -f http://localhost:3000/health || exit 1 -CMD ["node", "apps/api/dist/index.js"] +CMD ["node", "dist/index.js"] +# Migrate stage — runs drizzle-kit migrate against the database FROM builder AS migrate -CMD ["pnpm", "--filter", "@groombook/api", "db:migrate"] +CMD ["pnpm", "--filter", "@groombook/db", "migrate"] +# Seed stage — populates the database with test data FROM builder AS seed -CMD ["pnpm", "--filter", "@groombook/api", "db:seed"] +CMD ["pnpm", "--filter", "@groombook/db", "seed"] +# Reset stage — drops all tables, re-runs migrations, and re-seeds FROM builder AS reset -CMD ["pnpm", "--filter", "@groombook/api", "db:reset"] +CMD ["pnpm", "--filter", "@groombook/db", "reset"]