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

# Create non-root user (HF Spaces runs with user ID 1000)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR /app

# Install dependencies
COPY --chown=user server/requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# Copy all source code
COPY --chown=user . .

# HF Spaces uses port 7860 by default
ENV PORT=7860
EXPOSE 7860

# Run the FastAPI server
CMD ["python", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]