mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 20:21:09 +02:00
Phase 2f-2. RSS/Atom ingester (15-min tick → mana_platform.news.curated_articles) moved to GPU-Box. Service has zero hot-path coupling, all the writes go cross-LAN to Mini-postgres analog to the Glitchtip pattern. Two implementation gotchas worth recording: 1. cross-arch image transfer doesn't work. Saved news-ingester:local from the Mini (Apple M4 → linux/arm64), tried `docker load` on the GPU-Box (linux/amd64) and got 'exec format error' on every restart. Native build on the GPU-Box was the only path forward. 2. The original services/news-ingester/Dockerfile assumes pnpm-workspace state from prior builds (no COPY for packages/shared-rss in the build context). Fresh builds error with ERR_PNPM_WORKSPACE_PKG_NOT_FOUND. Workaround: a GPU-Box-specific Dockerfile at infrastructure/news-ingester/ that vendors shared-rss into the build via a workspace:* → file:ref sed swap. Build context is the repo root (sparse-clone provides packages/shared-rss + services/news-ingester). The Mini-side Dockerfile stays untouched so existing CD builds aren't disturbed. Mini-side: container stopped + removed from docker-compose.macmini.yml, running container count 44 → 39. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
21 lines
1,011 B
Docker
21 lines
1,011 B
Docker
# News-ingester for GPU-Box — workspace-aware (vendors shared-rss).
|
|
# Context: repo root. Use this Dockerfile when deploying news-ingester
|
|
# on the GPU-Box (the one in services/news-ingester/Dockerfile is
|
|
# Mini-side and assumes the cached pnpm-workspace state).
|
|
FROM oven/bun:1 AS production
|
|
WORKDIR /app
|
|
|
|
COPY packages/shared-rss ./packages/shared-rss
|
|
COPY services/news-ingester/package.json ./services/news-ingester/
|
|
COPY services/news-ingester/src ./services/news-ingester/src
|
|
COPY services/news-ingester/tsconfig.json services/news-ingester/drizzle.config.ts ./services/news-ingester/
|
|
|
|
WORKDIR /app/services/news-ingester
|
|
RUN sed -i 's|"@mana/shared-rss": "workspace:\*"|"@mana/shared-rss": "file:../../packages/shared-rss"|' package.json && \
|
|
bun install
|
|
|
|
EXPOSE 3066
|
|
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
|
|
CMD bun -e "fetch('http://localhost:3066/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
|
|
|
|
CMD ["bun", "run", "src/index.ts"]
|