Spaces:
Running

File size: 850 Bytes
0101ac9
a33a0a3
81b8db8
07e9c53
 
 
 
 
 
 
6825761
 
 
567644c
6825761
f6c3fa4
 
a33a0a3
567644c
88bb813
f6c3fa4
 
88bb813
a33a0a3
88bb813
6825761
07e9c53
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.11-slim
WORKDIR /app

# 1. Install system compilation tools and PortAudio dependencies
RUN apt-get update && apt-get install -y \
    gcc \
    python3-dev \
    portaudio19-dev \
    && rm -rf /var/lib/apt/lists/*

# 2. Install CPU-only versions of torch and torchaudio FIRST
#    This must happen BEFORE installing requirements.txt
RUN pip install --no-cache-dir torch==2.6.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cpu

# 3. Copy and install Python dependencies (which no longer include torch)
COPY backend/requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# 4. Copy the application folders into the workspace context
COPY backend/ ./backend
COPY frontend/ ./frontend

WORKDIR /app/backend
EXPOSE 7860

# 5. Launch uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]