File size: 681 Bytes
df79ac0
4493832
 
df79ac0
4493832
 
df79ac0
4493832
 
 
df79ac0
4493832
 
df79ac0
4493832
 
 
df79ac0
4493832
 
df79ac0
 
 
 
 
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
# Use an official lightweight Python image
FROM python:3.9-slim

# Set working directory
WORKDIR /code

# Install system dependencies for audio processing
RUN apt-get update && apt-get install -y \
    libsndfile1 \
    ffmpeg \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first to leverage Docker cache
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

# Copy the application code and model
COPY . .

# Expose the port FastAPI runs on
EXPOSE 7860

# Run with 1 worker to maximize RAM availability per request
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]