recursiverall commited on
Commit
46b8ab1
·
verified ·
1 Parent(s): 070de62

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -21
Dockerfile CHANGED
@@ -1,31 +1,26 @@
1
  # Dockerfile
2
- FROM ghcr.io/berriai/litellm:main-latest
3
 
4
- # Switch to root temporarily to perform filesystem modifications
5
- USER root
6
 
7
- WORKDIR /app
 
8
 
9
- # REROUTE: Force all user-level caches to map into our working directory
10
- # instead of the restricted /root or / directories.
11
- ENV HOME=/app
12
- ENV XDG_CACHE_HOME=/app/.cache
13
 
14
- COPY litellm_config.yaml /app/litellm_config.yaml
 
 
15
 
16
- # 1. Create the local cache directory for Prisma database binaries
17
- # 2. Pre-create the UI output directory to eliminate the restructuring warning
18
- # 3. Grant the Hugging Face user (UID 1000) full ownership of both the app
19
- # directory and the internal LiteLLM package paths
20
- RUN mkdir -p /app/.cache \
21
- && mkdir -p /usr/lib/python3.13/site-packages/litellm/proxy/_experimental/out \
22
- && chown -R 1000:1000 /app \
23
- && chown -R 1000:1000 /usr/lib/python3.13/site-packages/litellm
24
 
25
- # Switch back to the required Hugging Face non-root user
26
- USER 1000
27
 
28
  EXPOSE 7860
29
 
30
- # Execute the LiteLLM proxy
31
- CMD ["--config", "/app/litellm_config.yaml", "--port", "7860", "--detailed_debug"]
 
1
  # Dockerfile
2
+ FROM docker.litellm.ai/berriai/litellm:main-stable
3
 
4
+ # Hugging Face Spaces expects the app to listen on 7860
5
+ ENV PORT=7860
6
 
7
+ # Free CPU Spaces + Supabase free tier => keep this conservative
8
+ ENV NUM_WORKERS=1
9
 
10
+ # Apply Prisma migrations automatically on startup (recommended for prod)
11
+ ENV USE_PRISMA_MIGRATE=True
 
 
12
 
13
+ # Make the root URL go to the Admin UI, and move Swagger to /docs
14
+ ENV DOCS_URL=/docs
15
+ ENV ROOT_REDIRECT_URL=/ui
16
 
17
+ # Optional: cleaner logs
18
+ # ENV JSON_LOGS=True
 
 
 
 
 
 
19
 
20
+ # Copy a minimal config (no secrets inside)
21
+ COPY litellm_config.yaml /app/config.yaml
22
 
23
  EXPOSE 7860
24
 
25
+ # Base image entrypoint runs litellm; CMD supplies args
26
+ CMD ["--config", "/app/config.yaml", "--host", "0.0.0.0"]