File size: 1,006 Bytes
7d479ad
aa2fa98
 
 
 
 
fa81843
aa2fa98
 
 
 
 
 
 
8a841b2
 
f307930
aa2fa98
 
f307930
aa2fa98
8a841b2
aa2fa98
 
8a841b2
f307930
aa2fa98
8a841b2
f307930
aa2fa98
 
 
ce339c7
 
8a841b2
fa81843
 
8a841b2
f307930
fa81843
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
32
33
34
35
36
37
38
39
40
41
# Python 3.12 high-performance inference gateway
FROM python:3.12-slim

# Set environment variables
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1 \
    PORT=7860 \
    DATABASE_URL=sqlite+aiosqlite:////app/inferroute.db \
    MOCK_OPENAI=true \
    MOCK_GEMINI=true \
    MOCK_VLLM=true \
    MOCK_OLLAMA=true

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements file first for caching
COPY requirements.txt .

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

# Copy project source code
COPY inferroute/ ./inferroute/
COPY docs/ ./docs/
COPY benchmarks/ ./benchmarks/
COPY *.html ./
COPY assets/ ./assets/

# Expose default port (7860 for Hugging Face Spaces)
EXPOSE 7860

# Launch Uvicorn gateway
CMD ["sh", "-c", "python -m uvicorn inferroute.main:app --host 0.0.0.0 --port ${PORT:-7860}"]