Files
DocsGPT/deployment/docker-compose-standalone.yaml
T
Alex 68d9772f2e docs: docsgpt up and the new data home; CI runs up against the built image
Docker-Deploying gains a `docsgpt up` section, Pip-Install and Upgrading
describe the ~/.docsgpt/server data home, and the changelog covers both.

docker-image-verify.yml installs the wheel and runs `docsgpt up`, `status`,
a second `up` that must keep the secrets, and `uninstall --purge` against
the image it built. The standalone Compose file maps host.docker.internal
to the host gateway, so a model server on a Linux host is reachable the way
`docsgpt up` suggests.
2026-09-15 23:00:23 +01:00

157 lines
6.2 KiB
YAML

# DocsGPT from pre-built images, with no git checkout.
#
# curl -fsSLO https://raw.githubusercontent.com/arc53/DocsGPT/main/deployment/docker-compose-standalone.yaml
# printf 'LLM_PROVIDER=docsgpt\nVITE_API_STREAMING=true\nINTERNAL_KEY=%s\n' "$(openssl rand -hex 16)" > .env
# docker compose -f docker-compose-standalone.yaml up -d
# open http://localhost:7091
#
# INTERNAL_KEY is the shared secret the worker uses to hand finished indexes to
# the API; without it every ingest fails with a 401 (setup.sh generates one).
#
# The backend image serves the web UI and the API on one port. Every release
# also attaches this file as an asset, and `docsgpt up` runs it from the Python
# package. Settings come from .env next to this file (any DocsGPT setting,
# VITE_* included; the compose-internal service URLs below take precedence).
# Data lives in named volumes, so `docker compose down` keeps it and
# `docker compose down -v` removes it.
#
# DOCSGPT_IMAGE_TAG release to run, e.g. 0.20.0 (default: latest release);
# develop follows the main branch
# DOCSGPT_IMAGE_VARIANT empty (slim, default) or -docling: docling parser
# engine, its models, and tesseract baked in (OCR-ready)
# DOCSGPT_BIND interface the port is published on: 127.0.0.1 (default,
# this machine only) or 0.0.0.0 (every interface; set
# AUTH_TYPE, see the DocsGPT settings guide)
# DOCSGPT_PORT host port for the UI and API (default: 7091)
# POSTGRES_PASSWORD database password (default: docsgpt). Read when the
# postgres volume is first created; changing it later
# does not change the existing database's password.
# Use URL-safe characters (e.g. openssl rand -hex 24).
# DOCSGPT_DOMAIN public domain for the `https` profile (below)
# EMBEDDINGS_NAME defaults to granite here (this stack always starts on
# fresh volumes, so there is no older index to keep
# compatible); the code default stays mpnet for upgrades.
#
# HTTPS for a public domain: point the domain's DNS at this machine, open ports
# 80 and 443, then
# DOCSGPT_DOMAIN=docs.example.com docker compose -f docker-compose-standalone.yaml --profile https up -d
# Caddy obtains and renews the certificate and proxies to the backend. Putting
# DOCSGPT_DOMAIN and COMPOSE_PROFILES=https in .env instead makes every later
# `up`, `down` and `logs` include Caddy without the flag.
name: docsgpt
services:
backend:
image: arc53/docsgpt:${DOCSGPT_IMAGE_TAG:-latest}${DOCSGPT_IMAGE_VARIANT:-}
# Same as docker-compose-hub.yaml: the data volumes are written by root so
# any image tag works, including releases that predate the appuser-owned
# /app/inputs, /app/indexes and /app/vectors directories.
user: root
env_file:
- path: .env
required: false
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CACHE_REDIS_URL=redis://redis:6379/2
- POSTGRES_URI=postgresql://docsgpt:${POSTGRES_PASSWORD:-docsgpt}@postgres:5432/docsgpt
- EMBEDDINGS_NAME=${EMBEDDINGS_NAME:-ibm-granite/granite-embedding-311m-multilingual-r2}
# A model server on the host (Ollama, vLLM, ...) is reachable as
# host.docker.internal on Linux too, as it is on Docker Desktop.
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "${DOCSGPT_BIND:-127.0.0.1}:${DOCSGPT_PORT:-7091}:7091"
volumes:
- indexes:/app/indexes
- inputs:/app/inputs
- vectors:/app/vectors
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
restart: unless-stopped
worker:
image: arc53/docsgpt:${DOCSGPT_IMAGE_TAG:-latest}${DOCSGPT_IMAGE_VARIANT:-}
user: root
# Consumes the default queue plus `parsing` (read_document) and `embeddings`
# (query embedding); without the latter every search times out.
command: celery -A docsgpt.app.celery worker -l INFO -B -Q docsgpt,parsing,embeddings
env_file:
- path: .env
required: false
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/1
- CACHE_REDIS_URL=redis://redis:6379/2
- POSTGRES_URI=postgresql://docsgpt:${POSTGRES_PASSWORD:-docsgpt}@postgres:5432/docsgpt
- API_URL=http://backend:7091
- EMBEDDINGS_NAME=${EMBEDDINGS_NAME:-ibm-granite/granite-embedding-311m-multilingual-r2}
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- indexes:/app/indexes
- inputs:/app/inputs
- vectors:/app/vectors
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
restart: unless-stopped
redis:
image: redis:6-alpine
restart: unless-stopped
postgres:
image: postgres:16-alpine
environment:
- POSTGRES_USER=docsgpt
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-docsgpt}
- POSTGRES_DB=docsgpt
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U docsgpt -d docsgpt"]
interval: 5s
timeout: 5s
retries: 10
restart: unless-stopped
caddy:
image: caddy:2-alpine
profiles: [https]
environment:
- DOCSGPT_DOMAIN=${DOCSGPT_DOMAIN:-}
# The domain is checked here rather than with ${DOCSGPT_DOMAIN:?}: compose
# interpolates every service, so a required variable would break the stack
# for everyone who does not use this profile.
entrypoint: ["/bin/sh", "-c"]
command:
- >-
if [ -z "$$DOCSGPT_DOMAIN" ]; then
echo "caddy: set DOCSGPT_DOMAIN to the public domain" >&2; exit 1;
fi;
exec caddy reverse-proxy --from "$$DOCSGPT_DOMAIN" --to backend:7091
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- caddy_data:/data
- caddy_config:/config
depends_on:
- backend
restart: unless-stopped
volumes:
indexes:
inputs:
vectors:
postgres_data:
caddy_data:
caddy_config: