fix: usar adduser do Alpine em vez de useradd

- Imagem litellm/litellm:latest é baseada em Alpine Linux
- Alpine usa adduser, não useradd (Debian/Ubuntu)
- Corrige erro: /bin/sh: useradd: not found
This commit is contained in:
CM Consultor
2026-08-06 22:31:01 +00:00
parent 37e5d9ad0f
commit 84b4e4fea7

View File

@@ -14,8 +14,8 @@
# - A tiny wrapper entrypoint that runs litellm --config /app/config.yaml
# ---------------------------------------------------------------
# 1. Use the official LiteLLM image (based on python:3.12-slim)
FROM litellm/litellm:latest AS base
# 1. Use the official LiteLLM image (based on Alpine Linux)
FROM litellm/litellm:latest
# 2. Set environment variables that control the router
ENV \
@@ -26,10 +26,10 @@ ENV \
TOOL_ROUTER_ALWAYS_INCLUDE=get_time,help,list_tools \
TOOL_ROUTER_EMBEDDING_MODEL=text-embedding-3-small
# 3. Create a non-root user (optional but recommended)
RUN useradd -m litellm && \
# 3. Create a non-root user (Alpine uses adduser, not useradd)
RUN adduser -D -u 1000 litellm && \
mkdir -p /app && \
chown litellm:litellm /app
chown -R litellm:litellm /app
# 4. Switch to that user for the rest of the steps
USER litellm