File size: 845 Bytes
4702dbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
29
30
31
FROM python:3.10-slim

WORKDIR /app

# Copy all required files (9 essential files only)
COPY requirements.txt .
COPY inference.py .
COPY server.py .
COPY tasks.py .
COPY demo.py .
COPY README.md .
COPY openenv.yaml .
COPY .gitignore .

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

# Set environment defaults (can be overridden at runtime)
ENV API_BASE_URL="https://router.huggingface.co/v1"
ENV MODEL_NAME="Qwen/Qwen2.5-72B-Instruct"

# Expose port for Gradio (port 7860)
EXPOSE 7860

# Health check for HF Spaces
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s \
  CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health').status" 2>/dev/null || exit 1

# Default: run demo.py (Gradio UI)
# For evaluation, inference.py can be called directly
CMD ["python", "demo.py"]