File size: 654 Bytes
9fdf681
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
26
27
28
# Use lightweight python image
FROM python:3.10-slim

# Set strict limits awareness
ENV PYTHONUNBUFFERED=1
ENV API_BASE_URL="https://api.openai.com/v1"
ENV MODEL_NAME="gpt-4.1-mini"
ENV ENABLE_WEB_INTERFACE=true

# Setup working directory
WORKDIR /app
ENV PYTHONPATH=/app

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

# Copy all core files
COPY . /app

# Ensure HF Space port exposes correctly
EXPOSE 7860

# Alternative CMD for testing locally:
# CMD ["python", "inference.py"]

# CMD strictly runs the FastAPI server
CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]