File size: 700 Bytes
aac4f76
 
30f15fa
aac4f76
 
 
30f15fa
aac4f76
30f15fa
 
e3e42ae
aac4f76
30f15fa
f5af1f2
 
 
 
aac4f76
e3e42ae
aac4f76
 
 
30f15fa
aac4f76
 
30f15fa
aac4f76
 
30f15fa
 
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
FROM python:3.10-slim

# Prevent Python from writing .pyc files and buffer outputs
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Working directory
WORKDIR /app

# Create cache directory with full permissions
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache

# Environment variables for Hugging Face caching
ENV HF_HOME=/app/.cache
ENV TRANSFORMERS_CACHE=/app/.cache
ENV HF_DATASETS_CACHE=/app/.cache
ENV XDG_CACHE_HOME=/app/.cache

# Copy and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code
COPY . .

# Expose FastAPI default port
EXPOSE 7860

# Command to run the FastAPI app via Uvicorn
CMD ["python", "app.py"]