mirror of
https://github.com/Tencent/WeKnora.git
synced 2026-06-04 13:30:32 +08:00
feat(builtin-models): add YAML-based declarative config with ${ENV} interpolation
Allow built-in models to be declared in config/builtin_models.yaml
instead of inserting rows via SQL. On every startup the file is read
and each entry is UPSERT-ed into the models table (is_builtin=true)
by stable id.
Any string field may reference an environment variable with ${NAME}.
Unset variables are left as the literal placeholder so
misconfiguration surfaces clearly in provider calls rather than
failing silently with an empty token.
The file is optional: missing file, parse errors, and per-entry
upsert failures all log a warning without aborting startup.
docker-compose.yml adds env_file (.env, required:false) so
deployment-specific variables are passed through automatically.
This commit is contained in:
@@ -41,12 +41,23 @@ services:
|
||||
- ./config/config.yaml:/app/config/config.yaml
|
||||
# Optional: mount custom skills directory (allows adding skills without rebuilding image)
|
||||
- ./skills/preloaded:/app/skills/preloaded
|
||||
# Optional: declarative built-in models. Copy config/builtin_models.yaml.example
|
||||
# to config/builtin_models.yaml, edit it for your deployment, then
|
||||
# uncomment the line below. See docs/BUILTIN_MODELS.md.
|
||||
# - ./config/builtin_models.yaml:/app/config/builtin_models.yaml:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 60s
|
||||
# Optional: source .env so deployment-specific vars (e.g. those referenced
|
||||
# by config/builtin_models.yaml via ${ENV}) reach the app container without
|
||||
# having to be listed individually under `environment:`. Falls back
|
||||
# silently when .env is absent (e.g. fresh upstream clone).
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
environment:
|
||||
- LOG_LEVEL=${LOG_LEVEL:-}
|
||||
- COS_SECRET_ID=${COS_SECRET_ID:-}
|
||||
|
||||
Reference in New Issue
Block a user