File size: 595 Bytes
87ae954
 
 
 
6d2c12d
 
 
 
 
 
 
87ae954
 
6d2c12d
 
 
 
 
 
 
 
 
 
87ae954
 
 
 
6d2c12d
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
FROM python:3.10-slim

WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first
COPY requirements.txt .

# Install Python packages (use pre-built wheels)
RUN pip install --no-cache-dir --only-binary :all: \
    fastapi==0.104.1 \
    uvicorn==0.24.0 \
    numpy==1.24.3 \
    scikit-learn==1.3.0 \
    torch==2.0.1 \
    --index-url https://download.pytorch.org/whl/cpu

# Copy application
COPY app.py .

EXPOSE 7860

CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]