From 40a234e2ff820c45d1ee0bb9f4e0656a88b56376 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Mon, 5 Oct 2026 00:21:32 +0700 Subject: [PATCH] fix(litellm): build config.yaml into the image instead of bind-mounting it --- litellm/Dockerfile | 4 ++++ litellm/README.md | 10 +++++++--- litellm/compose.yml | 4 +--- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 litellm/Dockerfile diff --git a/litellm/Dockerfile b/litellm/Dockerfile new file mode 100644 index 0000000..a01a565 --- /dev/null +++ b/litellm/Dockerfile @@ -0,0 +1,4 @@ +FROM ghcr.io/berriai/litellm-database:main-stable + +# Proxy config: model list, routing and cache settings. +COPY config.yaml /app/config.yaml diff --git a/litellm/README.md b/litellm/README.md index 8811253..da90f98 100644 --- a/litellm/README.md +++ b/litellm/README.md @@ -20,8 +20,12 @@ Health check: `GET /health/liveliness`, also the compose healthcheck. ## Models `config.yaml` holds the model list, the `model_group_alias` routing and the -proxy settings; it is mounted read-only at `/app/config.yaml`. Editing it -redeploys the service. Every provider key in it is an `os.environ/` reference, +proxy settings. The `Dockerfile` copies it to `/app/config.yaml`, so editing it +rebuilds and redeploys the service. + +It is built into the image rather than bind-mounted because Coolify does not +place repository files beside the compose file it runs: a `./config.yaml` bind +mount finds nothing there, and Docker mounts an empty directory in its place. Every provider key in it is an `os.environ/` reference, so the file carries no secrets. Models can also be added in the admin UI. `STORE_MODEL_IN_DB` keeps those in @@ -65,7 +69,7 @@ enabled by uncommenting its line, without touching `config.yaml`. ## Images -`ghcr.io/berriai/litellm-database:main-stable` is the variant with the Prisma +The `Dockerfile` builds on `ghcr.io/berriai/litellm-database:main-stable`, the variant with the Prisma client for PostgreSQL built in. `main-stable` is upstream's moving stable tag. `postgres:16-alpine` and `redis:7-alpine` track their major versions. Moving diff --git a/litellm/compose.yml b/litellm/compose.yml index 9bc52c2..6cc46e8 100644 --- a/litellm/compose.yml +++ b/litellm/compose.yml @@ -1,6 +1,6 @@ services: litellm: - image: ghcr.io/berriai/litellm-database:main-stable + build: . restart: unless-stopped environment: - LITELLM_MASTER_KEY=${LITELLM_MASTER_KEY:?required} @@ -24,8 +24,6 @@ services: # - OLLAMA_API_KEY=${OLLAMA_API_KEY:-} # - CLOUDFLARE_API_KEY=${CLOUDFLARE_API_KEY:-} # - CLOUDFLARE_ACCOUNT_ID=${CLOUDFLARE_ACCOUNT_ID:-} - volumes: - - ./config.yaml:/app/config.yaml:ro command: - --config - /app/config.yaml