File size: 653 Bytes
d68c0f8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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.10-slim

WORKDIR /app

# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY . .

# Create a user to avoid running as root (Good practice for HF)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user     PATH=/home/user/.local/bin:$PATH

# Expose port (HF expects 7860 usually, but we can configure whatever)
# Actually, HF Spaces map port 7860 by default for Gradio/Streamlit, 
# for Docker we must listen on 7860.
EXPOSE 7860

# Command to run
# We must launch uvicorn on 0.0.0.0:7860
CMD ["uvicorn", "chiral_api:app", "--host", "0.0.0.0", "--port", "7860"]