From dab9bfab719ec069929ceb2842a85cf182f874f1 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Fri, 22 May 2026 12:57:55 +0000 Subject: [PATCH] fix(GRO-1533): revert Dockerfile to build from apps/api/src/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Dockerfile build change (pnpm build → pnpm --filter @groombook/api) was made against dev HEAD, but the root src/ directory was never fully audited for parity with apps/api/src/. Admin routes returning 500 for authenticated users post-OIDC login is consistent with the image running code with incomplete middleware chain or mismatched schema types when the root build path was used. Revert to the apps/api/ build path which is known to work correctly. UAT is running images from dev branch commit 9462915 which includes this change alongside schema cleanup commits. Root cause: Dockerfile was changed to build from root src/ instead of apps/api/src/ without confirming the two source trees are functionally identical. The proper fix path (schema audit + reconciliation) is tracked in GRO-1536. Co-Authored-By: Paperclip --- Dockerfile | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac523cc..17923b2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,19 +5,14 @@ WORKDIR /app # Install deps FROM base AS deps COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./ -COPY packages/db/package.json packages/db/ -COPY packages/types/package.json packages/types/ +COPY apps/api/package.json apps/api/ RUN pnpm install --frozen-lockfile # Build FROM deps AS builder RUN mkdir -p /home/node/.cache/node/corepack -COPY packages/ packages/ -COPY src/ src/ -COPY tsconfig.json ./ -RUN pnpm --filter @groombook/types build && \ - pnpm --filter @groombook/db build && \ - pnpm build +COPY apps/api/ apps/api/ +RUN pnpm --filter @groombook/api build # Runtime FROM node:22-alpine AS runner @@ -25,29 +20,22 @@ RUN corepack enable && corepack prepare pnpm@9.15.4 --activate WORKDIR /app ENV NODE_ENV=production -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 +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 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", "dist/index.js"] +CMD ["node", "apps/api/dist/index.js"] -# Migrate stage — runs drizzle-kit migrate against the database FROM builder AS migrate -CMD ["pnpm", "--filter", "@groombook/db", "migrate"] +CMD ["pnpm", "--filter", "@groombook/api", "db:migrate"] -# Seed stage — populates the database with test data FROM builder AS seed -CMD ["pnpm", "--filter", "@groombook/db", "seed"] +CMD ["pnpm", "--filter", "@groombook/api", "db:seed"] -# Reset stage — drops all tables, re-runs migrations, and re-seeds FROM builder AS reset -CMD ["pnpm", "--filter", "@groombook/db", "reset"] +CMD ["pnpm", "--filter", "@groombook/api", "db:reset"]