File size: 970 Bytes
4187281
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
33
34
35
36
37
38
39
FROM python:3.11-slim

# ---- Set environment variables (Updated here only for HF compatibility) ----
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/app/.cache/transformers
ENV HF_HOME=/app/.cache/huggingface

# ---- Optional: define keys via secrets, not hardcoded ----
# ENV DEEPGRAM_API_KEY=your_key
# ENV OPENAI_API_KEY=your_key

# ---- Set working directory ----
WORKDIR /app

# Add below WORKDIR /app
RUN mkdir -p /app/.cache/transformers /app/.cache/huggingface
RUN chmod -R 777 /app/.cache

# ---- Install system dependencies ----
RUN apt-get update && apt-get install -y \
    ffmpeg \
    build-essential \
    libsndfile1 \
    && rm -rf /var/lib/apt/lists/*


# ---- Copy project files ----
COPY . /app

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

# ---- Expose port ----
EXPOSE 7860

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