mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 16:16:48 +00:00
build(docker): slim backend image, static frontend image, -docling variant
Backend (arc53/docsgpt): 4.5 GB compressed -> 0.9 GB with both embedding models and tiktoken baked in. - torch/transformers gone from the default install (docling extra only). - Ubuntu 24.04 ships python3.12: no deadsnakes PPA, no software-properties- common; every pin is a wheel, so no gcc/g++/rust in the builder. - COPY --chown and a prefetch that runs as the process user replace the trailing chown -R, which duplicated the 600 MB model layer. - .dockerignore keeps __pycache__, .coverage, local indexes and .env out. - EXTRAS build arg (INSTALL_DOCLING kept as an alias); the docling variant also bakes docling's layout/table/RapidOCR models (DOCLING_ARTIFACTS_PATH) and tesseract, and drops only the discovery documents of Google APIs the app never builds. - FLASK_DEBUG env removed (unused); OCI labels added. Frontend (arc53/docsgpt-fe): 302 MB Vite dev server -> 25 MB static build behind nginx. VITE_* variables are injected at container start into /config.js and read through src/env.ts, so the image no longer needs a rebuild per deployment; docker-compose.yaml keeps hot reload via the dev target. Publishing: every release and develop build now pushes a slim tag and a -docling tag (docling engine + models + tesseract). docker-compose-hub.yaml takes DOCSGPT_IMAGE_TAG / DOCSGPT_IMAGE_VARIANT; docker-compose-standalone.yaml runs the stack from pre-built images without a checkout and is attached to each release. setup.sh selects the -docling variant for OCR instead of requiring a local build. A new workflow builds the image on PRs that touch it and runs verify_offline under --network none; lint checks the exported requirements match uv.lock.
This commit is contained in:
1 parent
4707c45b93
commit
aecb596e99
30 files changed
+706
-247
No files matched your search
@@ -1,7 +1,11 @@
|
||||
name: docsgpt-oss
|
||||
services:
|
||||
frontend:
|
||||
build: ../frontend
|
||||
build:
|
||||
context: ../frontend
|
||||
# Vite dev server with hot reload over the bind mount below. The default
|
||||
# target (what Docker Hub publishes) is a static build behind nginx.
|
||||
target: dev
|
||||
volumes:
|
||||
- ../frontend/src:/app/src
|
||||
environment:
|
||||
@@ -18,8 +22,10 @@ services:
|
||||
build:
|
||||
context: ../application
|
||||
args:
|
||||
# Bake the optional docling engine (layout-model OCR backend, structured
|
||||
# output) into the image: set INSTALL_DOCLING=true in ../.env or the shell.
|
||||
# Optional extras to bake in (comma-separated): docling, milvus. The
|
||||
# docling extra brings the layout-model parser/OCR backend and its
|
||||
# models. INSTALL_DOCLING=true is the older spelling of EXTRAS=docling.
|
||||
EXTRAS: ${EXTRAS:-}
|
||||
INSTALL_DOCLING: ${INSTALL_DOCLING:-false}
|
||||
# Bake the tesseract binary behind OCR_ENABLED=true (~35 MB): set
|
||||
# INSTALL_TESSERACT=true in ../.env or the shell (setup.sh does this
|
||||
@@ -53,6 +59,7 @@ services:
|
||||
build:
|
||||
context: ../application
|
||||
args:
|
||||
EXTRAS: ${EXTRAS:-}
|
||||
INSTALL_DOCLING: ${INSTALL_DOCLING:-false}
|
||||
INSTALL_TESSERACT: ${INSTALL_TESSERACT:-false}
|
||||
# Consumes the default queue AND the dedicated `parsing` (read_document /
|
||||
|
||||
Reference in new issue
Block a user