File size: 611 Bytes
e320304
6d999be
e320304
 
6d999be
e320304
 
6d999be
e320304
 
 
 
 
 
 
6d999be
e320304
 
 
6d999be
e320304
 
 
 
6d999be
e320304
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
FROM python:3.10-slim

# Set up working directory
WORKDIR /app

# Create writable cache directory early
RUN mkdir -p /app/cache && chmod 777 /app/cache

# Set environment variables to use it
ENV TRANSFORMERS_CACHE=/app/cache
ENV TORCH_HOME=/app/cache
ENV HF_HOME=/app/cache

# Install required tools
RUN apt-get update && apt-get install -y ffmpeg wget tar && rm -rf /var/lib/apt/lists/*

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

# Copy all code
COPY . .

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