fix: decode Vertex ADC with Python

This commit is contained in:
Codex
2026-07-22 00:33:04 -07:00
parent f619c91590
commit 5f42e60df5
+7 -4
View File
@@ -12,12 +12,15 @@ services:
LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY} LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY}
volumes: volumes:
- ./config.yaml:/app/config.yaml:ro - ./config.yaml:/app/config.yaml:ro
entrypoint: ["/bin/sh", "-c"] entrypoint: ["python", "-c"]
command: command:
- | - |
umask 077 import base64, os
printf '%s' "$${GOOGLE_ADC_B64}" | base64 -d > /tmp/application_default_credentials.json path = "/tmp/application_default_credentials.json"
exec litellm --config /app/config.yaml --host 0.0.0.0 --port 4000 with open(path, "wb") as credential_file:
credential_file.write(base64.b64decode(os.environ["GOOGLE_ADC_B64"]))
os.chmod(path, 0o600)
os.execvp("litellm", ["litellm", "--config", "/app/config.yaml", "--host", "0.0.0.0", "--port", "4000"])
logging: logging:
driver: json-file driver: json-file
options: options: