immortalindeed commited on
Commit
cfda61e
·
1 Parent(s): 6f95f2a

fix(docker): copy /usr/local/bin from builder so uvicorn is on PATH

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -2,7 +2,7 @@
2
  FROM python:3.10-slim AS builder
3
  WORKDIR /build
4
  COPY pyproject.toml .
5
- RUN pip install --no-cache-dir --target=/install . || pip install --no-cache-dir --target=/install fastapi uvicorn pydantic openai requests packaging gradio python-dotenv
6
 
7
  # Stage 2: Runtime
8
  FROM python:3.10-slim
@@ -12,8 +12,9 @@ LABEL openenv="true"
12
 
13
  WORKDIR /app
14
 
15
- # Copy only installed packages (not build tools)
16
- COPY --from=builder /install /usr/local/lib/python3.10/site-packages
 
17
 
18
  # Copy project files
19
  COPY . .
 
2
  FROM python:3.10-slim AS builder
3
  WORKDIR /build
4
  COPY pyproject.toml .
5
+ RUN pip install --no-cache-dir . || pip install --no-cache-dir fastapi uvicorn pydantic openai requests packaging gradio python-dotenv
6
 
7
  # Stage 2: Runtime
8
  FROM python:3.10-slim
 
12
 
13
  WORKDIR /app
14
 
15
+ # Copy installed packages AND scripts (uvicorn binary) from builder
16
+ COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
17
+ COPY --from=builder /usr/local/bin /usr/local/bin
18
 
19
  # Copy project files
20
  COPY . .