File size: 1,044 Bytes
53c7dd5
 
 
 
 
 
 
070f657
53c7dd5
 
47b3177
070f657
 
 
 
 
 
47b3177
070f657
 
47b3177
070f657
 
47b3177
53c7dd5
 
 
 
 
47b3177
53c7dd5
 
47b3177
 
 
 
 
 
070f657
55a61d6
53c7dd5
 
55a61d6
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
40
41
42
43
44
FROM python:3.10-slim

# Prevents Python from writing pyc files to disk and buffers logs immediately
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV TRANSFORMERS_CACHE=/tmp/huggingface

# Set working directory
WORKDIR /app

# Install system dependencies (PyAudio, ffmpeg, SQLite-compatible tools)
RUN apt-get update && apt-get install -y \
    gcc \
    g++ \
    make \
    python3-dev \
    portaudio19-dev \
    libasound-dev \
    ffmpeg \
    libsndfile1 \
    sqlite3 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for caching
COPY requirements.txt .

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

# Copy rest of the app code
COPY . .

# Ensure the directory has proper permissions (for SQLite file write)
RUN chmod -R 777 /app

# Optionally: Create the DB file if your app expects it to exist
RUN touch /app/app.db

# Expose FastAPI port
EXPOSE 7860

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