services: kw: image: ghcr.io/ufal/atrium-keyword-extract:${ATRIUM_VERSION:-dev} # The host uid, group 0 (atrium-project#69, roadmap B6). ./data is in the clone # (data/.gitkeep), owned by whoever cloned it, while the images run as uid 10001 by # default -- so without this every write to /data fails with EACCES. Every path the # images write is group-0 writable, so any uid with group 0 works. On Linux set # ATRIUM_UID in .env (`echo "ATRIUM_UID=$(id -u)" >> .env`); Docker Desktop needs # nothing. Unset, this is the images' own uid 10001. user: "${ATRIUM_UID:-10001}:0" build: context: . target: base args: ATRIUM_RUNNER_IMAGE: ghcr.io/ufal/atrium-keyword-extract:${ATRIUM_VERSION:-dev} ATRIUM_RUNNER_REPO: https://github.com/ufal/atrium-keyword-extract ATRIUM_RUNNER_REF: ${ATRIUM_RUNNER_REF:-dev} environment: ATRIUM_RUNNER_IMAGE: ghcr.io/ufal/atrium-keyword-extract:${ATRIUM_VERSION:-dev} ATRIUM_RUNNER_REPO: https://github.com/ufal/atrium-keyword-extract ATRIUM_RUNNER_REF: ${ATRIUM_RUNNER_REF:-dev} HF_HOME: /cache/huggingface volumes: - ./data:/data - hf-cache:/cache/huggingface kw-api: profiles: [api] # The published names (atrium-project#69, roadmap B2): the target is part of the image # NAME, as docker-tool.reusable.yml publishes it -- `atrium-keyword-extract-api:`, # never `atrium-keyword-extract:-api` -- so `docker compose --profile api pull` # fetches the released image. Same for `-llm` below. image: ghcr.io/ufal/atrium-keyword-extract-api:${ATRIUM_VERSION:-dev} user: "${ATRIUM_UID:-10001}:0" # see the kw service above (roadmap B6) build: context: . target: api args: ATRIUM_RUNNER_IMAGE: ghcr.io/ufal/atrium-keyword-extract-api:${ATRIUM_VERSION:-dev} ATRIUM_RUNNER_REPO: https://github.com/ufal/atrium-keyword-extract ATRIUM_RUNNER_REF: ${ATRIUM_RUNNER_REF:-dev} # env_file delivers every OTHER variable in .env.example into the container -- # LOG_LEVEL, HOST, GRACEFUL_SHUTDOWN_S, RELOAD, ALLOWED_ORIGINS, MAX_UPLOAD_MB, # MAX_DOCUMENT_WORDS, MAX_KEYWORDS and the KeyBERT chunk limits (atrium-project#60). # `required: false` because .env is gitignored -- a fresh clone has none and compose # must still start. env_file: - path: .env required: false environment: # ${VAR:-default} lets .env (or a shell export) win while keeping the same default # when neither is set; a literal here would override whatever .env says. MAX_CONCURRENT_REQUESTS: ${MAX_CONCURRENT_REQUESTS:-2} DEFAULT_KW_METHOD: ${DEFAULT_KW_METHOD:-keybert} HF_HOME: /cache/huggingface PORT: ${PORT:-8000} # The controlled kind with LLM_BACKEND=ollama: the HOST's Ollama. The code default, # http://localhost:11434, is this container's own loopback, where no Ollama runs. OLLAMA_HOST: ${OLLAMA_HOST:-http://host.docker.internal:11434} # host.docker.internal resolves on Docker Desktop by itself; on Linux this maps it. extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./data:/data - hf-cache:/cache/huggingface ports: # PORT is passed through so `PORT=9000 docker compose --profile api up` moves the # listener, the published port and the container's own HEALTHCHECK together — the # service reads it in service/api.py's __main__ block and service/healthcheck.py # probes it. (atrium-project#58) - "${PORT:-8000}:${PORT:-8000}" # HEALTHCHECK is already declared on the `api` Dockerfile stage — no override needed # here. stop_grace_period raised from Compose's own 10s default (issue #55): uvicorn # waits up to GRACEFUL_SHUTDOWN_S (20) for in-flight requests and serve_lifecycle's # own drain adds up to another 25s on top. Same budget as # docs/templates/k8s/atrium-service.deployment.yaml's terminationGracePeriodSeconds. stop_grace_period: 60s kw-llm: profiles: [llm] image: ghcr.io/ufal/atrium-keyword-extract-llm:${ATRIUM_VERSION:-dev} user: "${ATRIUM_UID:-10001}:0" # see the kw service above (roadmap B6) build: context: . target: llm args: ATRIUM_RUNNER_IMAGE: ghcr.io/ufal/atrium-keyword-extract-llm:${ATRIUM_VERSION:-dev} ATRIUM_RUNNER_REPO: https://github.com/ufal/atrium-keyword-extract ATRIUM_RUNNER_REF: ${ATRIUM_RUNNER_REF:-dev} environment: ATRIUM_RUNNER_IMAGE: ghcr.io/ufal/atrium-keyword-extract-llm:${ATRIUM_VERSION:-dev} ATRIUM_RUNNER_REPO: https://github.com/ufal/atrium-keyword-extract ATRIUM_RUNNER_REF: ${ATRIUM_RUNNER_REF:-dev} HF_HOME: /cache/huggingface HF_TOKEN: ${HF_TOKEN:-} volumes: - ./data:/data - hf-cache:/cache/huggingface - ./llm_config.txt:/app/llm_config.txt:ro volumes: hf-cache: