Core service URLs: Make ArangoDB, Backend, Doc-repo, Redis, Keycloak internal URLs configurable
Parent: #758 (closed)
Summary
Make all core service URLs configurable via env vars in docker-compose.yaml, using the same ${VAR:-default} pattern. These are the non-OPEA services that communicate via hardcoded Docker DNS names.
Current State — Hardcoded References
ArangoDB (http://arango-vector-db:8529)
Referenced in 5 services — NOT configurable:
# backend (line ~357)
- ARANGO_URL=http://arango-vector-db:8529
# document-repository (line ~408)
- ARANGO_URL=http://arango-vector-db:8529
# dataprep-arango-service (line ~893)
ARANGO_URL: http://arango-vector-db:8529
# retriever-arango-service (line ~952)
ARANGO_URL: http://arango-vector-db:8529
# chatqna-xeon-backend-server (line ~474)
- ARANGO_URL=http://arango-vector-db:8529
Backend (http://backend:3000)
Referenced in 2 OPEA services — NOT configurable:
# dataprep (line ~899)
BACKEND_SERVICE_URL: http://backend:3000
# chatqna (line ~1032)
BACKEND_SERVICE_URL: http://backend:3000
Document Repository (http://document-repository:3001)
Referenced in 2 OPEA services — NOT configurable:
# dataprep (line ~898)
DOCUMENT_REPOSITORY_URL: http://document-repository:3001
# chatqna (line ~1031)
DOC_REPO_URL: http://document-repository:3001
Keycloak Internal (http://keycloak:8080)
Referenced in keycloak-config — NOT configurable:
# keycloak-config (line ~1199)
- KEYCLOAK_URL=http://keycloak:8080
Redis (redis-cache:6379)
Partially configurable — backend reads TRANSLATION_CACHE_HOST with default redis-cache, but this is only for translation cache. Other Redis references may exist.
Target State
All references become ${VAR:-docker-dns-default}:
# In every service that references ArangoDB:
- ARANGO_URL=${ARANGO_URL:-http://arango-vector-db:8529}
# In dataprep and chatqna:
BACKEND_SERVICE_URL: ${BACKEND_SERVICE_URL:-http://backend:3000}
# In dataprep and chatqna:
DOCUMENT_REPOSITORY_URL: ${DOCUMENT_REPOSITORY_URL:-http://document-repository:3001}
DOC_REPO_URL: ${DOC_REPO_URL:-http://document-repository:3001}
# In keycloak-config:
- KEYCLOAK_URL=${KEYCLOAK_INTERNAL_URL:-http://keycloak:8080}
# In backend:
- TRANSLATION_CACHE_HOST=${TRANSLATION_CACHE_HOST:-redis-cache}
Implementation
This is a docker-compose.yaml only change. No Python or Node.js code changes needed — services already read these URLs from environment variables.
- Find all 5 ArangoDB references → wrap in
${ARANGO_URL:-...} - Find 2 backend references → wrap in
${BACKEND_SERVICE_URL:-...} - Find 2 doc-repo references → wrap in
${DOCUMENT_REPOSITORY_URL:-...}/${DOC_REPO_URL:-...} - Find keycloak-config reference → wrap in
${KEYCLOAK_INTERNAL_URL:-...} - Verify
TRANSLATION_CACHE_HOSTalready uses the pattern (it does)
Files
| File | Change |
|---|---|
docker-compose.yaml |
~12 environment value changes from hardcoded to ${VAR:-default}
|
Acceptance Criteria
-
All ArangoDB URL references use ${ARANGO_URL:-http://arango-vector-db:8529} -
Backend URL references use ${BACKEND_SERVICE_URL:-http://backend:3000} -
Doc-repo URL references use ${DOCUMENT_REPOSITORY_URL:-...}and${DOC_REPO_URL:-...} -
Keycloak internal URL uses ${KEYCLOAK_INTERNAL_URL:-http://keycloak:8080} -
No behavior change when no env vars are set (defaults = current Docker DNS names) -
docker compose configvalidates without errors -
Setting ARANGO_URL=http://10.0.0.60:8529in.envcorrectly overrides for all 5 services