Kaballas commited on
Commit
70ad7c8
·
1 Parent(s): fb938a2
Files changed (2) hide show
  1. Dockerfile +13 -10
  2. requirements.txt +4 -0
Dockerfile CHANGED
@@ -1,16 +1,19 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
 
4
- FROM python:3.9
5
-
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
 
 
 
 
 
10
  WORKDIR /app
 
11
 
12
- COPY --chown=user ./requirements.txt requirements.txt
13
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
 
15
- COPY --chown=user . /app
16
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM cgr.dev/chainguard/python:3.12 # Specific version, not dev variant
 
2
 
3
+ # Multi-stage for build dependencies
4
+ FROM cgr.dev/chainguard/python:3.12-dev as builder
5
+ WORKDIR /app
6
+ COPY requirements.txt .
7
+ RUN pip install --user --no-cache-dir -r requirements.txt
8
 
9
+ # Production stage
10
+ FROM cgr.dev/chainguard/python:3.12
11
+ RUN adduser -D -u 1000 litellm
12
+ USER litellm
13
  WORKDIR /app
14
+ ENV PATH="/home/litellm/.local/bin:$PATH"
15
 
16
+ COPY --from=builder --chown=litellm:litellm /root/.local /home/litellm/.local
17
+ COPY --chown=litellm:litellm . /app
18
 
 
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
requirements.txt CHANGED
@@ -1,2 +1,6 @@
1
  fastapi
2
  uvicorn[standard]
 
 
 
 
 
1
  fastapi
2
  uvicorn[standard]
3
+ litellm[proxy]==1.57.3 # Specify the litellm version you want to use
4
+ prometheus_client
5
+ langfuse
6
+ prisma