File size: 719 Bytes
30b84fa
 
52dad50
 
 
 
f0c24f2
 
 
30b84fa
52dad50
 
 
 
30b84fa
52dad50
30b84fa
 
52dad50
 
30b84fa
52dad50
f0c24f2
52dad50
 
30b84fa
 
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
# Use Python 3.12 slim for efficiency (CPU-only for torch)
FROM python:3.12-slim

# Set working directory
WORKDIR /app

# Set Hugging Face cache to writable dir
ENV TRANSFORMERS_CACHE=/tmp/huggingface

# Install system dependencies (for PDF handling and build tools)
RUN apt-get update && apt-get install -y \
    gcc \
    && rm -rf /var/lib/apt/lists/*

# Copy and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt \
    && pip install torch --index-url https://download.pytorch.org/whl/cpu --no-cache-dir

# Copy application code
COPY . .

# Expose port
EXPOSE 7860

# Run the app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]