docker: production image + Gitea Actions for monthly refresh
Image rebuild (skip scrape) / build (push) Failing after 1h37m12s
Image rebuild (skip scrape) / build (push) Failing after 1h37m12s
Dockerfile: self-contained image with corpus + Chroma + BM25 baked in. Drawbar's compose pulls + runs without volume mounts. Built from sources.json (labels schema), PRODUCT_NAME=crop_chem by default, HYBRID_SEARCH=true (always-on for production quality). RERANK_URL + OLLAMA_URL get set at compose time. .gitea/workflows/refresh.yml: monthly cron (1st @ 06:00 UTC) does full scrape → reindex → image push. Scrapes Bayer (~30 min) + EPA PPLS row-crop filtered (~7h). Skips reindex+push if no corpus diff. Tags pushed: :latest, :<sha12>, :corpus-<YYYY.MM.DD>. .gitea/workflows/image-only.yml: on-demand or auto on code-only pushes to main (paths: docs_mcp/, rag/, scrape/, requirements.txt, Dockerfile, sources.json). Reindexes from committed corpus, builds image, pushes. ~10 min vs ~9h full refresh. .gitignore: corpus/ now COMMITTED (4,159 labels, 265 MB of .md + sidecars). Lets image-only.yml rebuild indexes without re-scraping. chroma/ + bm25/ still gitignored (regenerable binary indexes). .dockerignore: drops venv, eval results, PLAN/README/CLAUDE.md, deploy/, .git/ — keeps the image lean. corpus + chroma + bm25 explicitly NOT in dockerignore (those go INTO the image). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+16
-4
@@ -1,4 +1,4 @@
|
||||
# Docs MCP server — production image.
|
||||
# crop-chem-docs MCP server — production image.
|
||||
#
|
||||
# Structure: copy code first, then the regenerable indexes last so a
|
||||
# code-only change doesn't invalidate the corpus COPY layer.
|
||||
@@ -6,6 +6,14 @@
|
||||
# The container runs the MCP server via streamable-http on PORT 8000.
|
||||
# Override via MCP_HOST / MCP_PORT env if you front it with a different
|
||||
# reverse-proxy setup.
|
||||
#
|
||||
# Image is self-contained — corpus, Chroma collection, and BM25 db are
|
||||
# all baked in. Drawbar's docker-compose pulls the image and runs it;
|
||||
# no host volume mounts required for serve.
|
||||
#
|
||||
# RERANK_URL is set at compose time (points at the llama.cpp sidecar
|
||||
# on trashpanda's Tesla P4). OLLAMA_URL is set at compose time too
|
||||
# (the embed-pool of Ollama instances). Defaults are commented inline.
|
||||
|
||||
FROM python:3.12-slim
|
||||
|
||||
@@ -20,8 +28,8 @@ COPY scrape /app/scrape
|
||||
COPY rag /app/rag
|
||||
COPY docs_mcp /app/docs_mcp
|
||||
|
||||
# Catalog. Written by the scraper at CI time.
|
||||
COPY bundles.json /app/
|
||||
# Source catalog. Lists the corpus sources (Bayer + EPA PPLS today).
|
||||
COPY sources.json /app/
|
||||
|
||||
# Regenerable indexes. CI builds these from corpus/ in the same job
|
||||
# that builds the image. Listed last so code changes don't invalidate
|
||||
@@ -34,9 +42,13 @@ COPY chroma /app/chroma
|
||||
COPY bm25 /app/bm25
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PRODUCT_NAME=crop_chem \
|
||||
MCP_TRANSPORT=streamable-http \
|
||||
MCP_HOST=0.0.0.0 \
|
||||
MCP_PORT=8000
|
||||
MCP_PORT=8000 \
|
||||
HYBRID_SEARCH=true
|
||||
# RERANK_URL set at deploy time, e.g. http://llama-rerank:8080
|
||||
# OLLAMA_URL set at deploy time, comma-separated list
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
|
||||
Reference in New Issue
Block a user