File size: 666 Bytes
64b4cae
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
FROM python:3.11-slim

# not using 3.13 in docker because slim image had some issues with it
# 3.11 is stable and the packages all work fine with it

WORKDIR /app

# copy requirements first so docker layer caching works
# (this layer only rebuilds if requirements.txt changes)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# copy everything else
COPY . .

# expose the port the server runs on
EXPOSE 7860

# HuggingFace Spaces uses port 7860
# PORT env var is set by HF, we fall back to 7860 if not set
ENV PORT=7860

# this works, don't touch it
CMD ["python", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]