Stack POL data in MySQL (Marty 2026-11-16: payout totals wiped on every deploy)

The indexer snapshot (was /tmp/stack-index.json) and the chatbot KB (was memory)
are now MySQL documents via docstore.js (DOCSTORE_URL, Coolify stackpol-mysql),
loaded before the server listens so a deploy shows the last totals at once.
Snapshot split into stack-index.json + stack-index-at.json so a push with no new
payouts rewrites only the tiny doc (docstore skips unchanged bodies). Ingest API
unchanged. Tested on core: restart keeps totals, /programs, /earn, member pages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-16 04:46:28 -06:00
parent b6e020e025
commit 96d6281e3e
8 changed files with 383 additions and 14 deletions
+3 -2
View File
@@ -1,10 +1,11 @@
FROM node:20-alpine
WORKDIR /app
COPY package.json package-lock.json server.js layout.js blog.js programs.js netsites.js chatbot.js chatcore.js kb.js netkb.js ./
COPY package.json package-lock.json server.js layout.js blog.js programs.js netsites.js chatbot.js chatcore.js kb.js netkb.js docstore.js ./
RUN npm ci --omit=dev --no-audit --no-fund
COPY content/ ./content/
COPY public/ ./public/
ENV NODE_ENV=production PORT=80
ENV NODE_ENV=production PORT=80 DATA_DIR=/app/data
RUN mkdir -p /app/data
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s CMD wget -qO- http://127.0.0.1/health || exit 1
CMD ["node", "server.js"]