File size: 624 Bytes
b577472
 
 
 
30f5f22
b577472
 
 
3e4e9a0
 
b577472
 
30f5f22
3e4e9a0
 
30f5f22
3e4e9a0
 
 
 
b577472
 
 
 
30f5f22
 
b577472
3e4e9a0
b577472
 
 
 
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
FROM python:3.9-slim

WORKDIR /app

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

# Create cache directory
RUN mkdir -p /.cache && chmod -R 777 /.cache

# Set environment variables
ENV TRANSFORMERS_CACHE=/.cache
ENV HF_HOME=/.cache
ENV HUGGINGFACE_HUB_CACHE=/.cache

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

# Copy application code
COPY main.py .

# Expose port
EXPOSE 7860

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