mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-03 09:12:55 +00:00
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.
97 lines
2.9 KiB
YAML
97 lines
2.9 KiB
YAML
services:
|
|
frontend:
|
|
build:
|
|
context: ../frontend
|
|
target: dev
|
|
environment:
|
|
- VITE_API_HOST=http://localhost:7091
|
|
- VITE_API_STREAMING=$VITE_API_STREAMING
|
|
ports:
|
|
- "5173:5173"
|
|
depends_on:
|
|
- backend
|
|
|
|
backend:
|
|
build:
|
|
context: ../application
|
|
args:
|
|
EXTRAS: ${EXTRAS:-}
|
|
INSTALL_DOCLING: ${INSTALL_DOCLING:-false}
|
|
# Off by default; deployments running OCR_ENABLED=true with tesseract
|
|
# must set INSTALL_TESSERACT=true before rebuilding (see docker-compose.yaml).
|
|
INSTALL_TESSERACT: ${INSTALL_TESSERACT:-false}
|
|
env_file:
|
|
- ../.env
|
|
environment:
|
|
# Override URLs to use docker service names
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/1
|
|
- POSTGRES_URI=postgresql://docsgpt:docsgpt@postgres:5432/docsgpt
|
|
ports:
|
|
- "7091:7091"
|
|
volumes:
|
|
- ../application/indexes:/app/application/indexes
|
|
- ../application/inputs:/app/application/inputs
|
|
- ../application/vectors:/app/application/vectors
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
worker:
|
|
build:
|
|
context: ../application
|
|
args:
|
|
EXTRAS: ${EXTRAS:-}
|
|
INSTALL_DOCLING: ${INSTALL_DOCLING:-false}
|
|
# Off by default; deployments running OCR_ENABLED=true with tesseract
|
|
# must set INSTALL_TESSERACT=true before rebuilding (see docker-compose.yaml).
|
|
INSTALL_TESSERACT: ${INSTALL_TESSERACT:-false}
|
|
# `parsing` queue carries read_document/parse_document; required for its await to resolve.
|
|
command: celery -A application.app.celery worker -l INFO -Q docsgpt,parsing,embeddings
|
|
env_file:
|
|
- ../.env
|
|
environment:
|
|
# Override URLs to use docker service names
|
|
- CELERY_BROKER_URL=redis://redis:6379/0
|
|
- CELERY_RESULT_BACKEND=redis://redis:6379/1
|
|
- API_URL=http://backend:7091
|
|
- POSTGRES_URI=postgresql://docsgpt:docsgpt@postgres:5432/docsgpt
|
|
depends_on:
|
|
redis:
|
|
condition: service_started
|
|
postgres:
|
|
condition: service_healthy
|
|
|
|
# NOTE: sandboxed code execution (the `code_executor` / `artifact_generator`
|
|
# tools) is an OPT-IN feature and is intentionally NOT part of this default
|
|
# stack. To run it, layer the sandbox overlay on top of this file:
|
|
# docker compose -f docker-compose-azure.yaml \
|
|
# -f optional/docker-compose.optional.sandbox.yaml up
|
|
# See deployment/sandbox/README.md.
|
|
|
|
redis:
|
|
image: redis:6-alpine
|
|
ports:
|
|
- 6379:6379
|
|
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
- POSTGRES_USER=docsgpt
|
|
- POSTGRES_PASSWORD=docsgpt
|
|
- POSTGRES_DB=docsgpt
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U docsgpt -d docsgpt"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
volumes:
|
|
postgres_data:
|