Temporarily expose bootstrap scope in startup logs

This commit is contained in:
Admin 2026-09-21 21:58:26 +00:00
parent 59047e5072
commit b380056928
2 changed files with 27 additions and 1 deletions

View File

@ -4,6 +4,7 @@ WORKDIR /src
COPY annonet-arrowstack-ready.zip /tmp/annonet.zip
RUN unzip -q /tmp/annonet.zip -d /src
COPY mcpAuthMiddleware.js /src/src/auth/mcpAuthMiddleware.js
COPY scopeProbe.js /src/scopeProbe.js
# Arrowstack's database-per-tenant runtime role intentionally cannot install
# extensions. PostgreSQL 13+ provides gen_random_uuid() in core, and annoNet
# does not use any other pgcrypto functions.
@ -23,6 +24,8 @@ ENV NODE_ENV=production \
HOST=0.0.0.0 \
PORT=8787
RUN apk add --no-cache curl
COPY --from=source /src/package*.json ./
RUN npm ci --omit=dev && npm cache clean --force
@ -30,6 +33,7 @@ COPY --from=source /src/src ./src
COPY --from=source /src/sql ./sql
COPY --from=source /src/scripts ./scripts
COPY --from=source /src/frontend ./frontend
COPY --from=source /src/scopeProbe.js ./scopeProbe.js
COPY --from=frontend-build /build/frontend-astro/dist ./public
RUN npm run check \
@ -42,4 +46,4 @@ EXPOSE 8787
HEALTHCHECK --interval=10s --timeout=5s --start-period=20s --retries=6 \
CMD node -e "fetch('http://127.0.0.1:8787/api/health/ready').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
CMD ["npm", "start"]
CMD ["sh", "-c", "npm run migrate && node scopeProbe.js && node src/server.js"]

22
scopeProbe.js Normal file
View File

@ -0,0 +1,22 @@
const { pool } = require("./src/db/pool");
(async () => {
try {
const { rows } = await pool.query(
`SELECT o.id AS org_id, t.id AS team_id
FROM orgs o
JOIN teams t ON t.org_id = o.id
WHERE o.name = 'Default Organization'
AND t.name = 'Default Team'
LIMIT 1`
);
if (rows[0]) {
console.log("[bootstrap-scope]", JSON.stringify(rows[0]));
}
} finally {
await pool.end();
}
})().catch((error) => {
console.error("[bootstrap-scope-error]", error);
process.exit(1);
});