File size: 926 Bytes
cb55d04
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile for deploying the Hugging Face application
FROM python:3.12-slim

WORKDIR /app

# Install system dependencies including audio libraries
RUN apt-get update && apt-get install -y \

    gcc \
    g++ \
    git \
    ffmpeg \
    portaudio19-dev \
    curl \
    && rm -rf /var/lib/apt/lists/* \
    && apt-get clean

# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy application files
COPY . .

# Create necessary directories
RUN mkdir -p static/audio config cache DataSet

# Expose port (Hugging Face uses 7860)
EXPOSE 7860

# Health check - use the correct port
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \

    CMD curl -f http://localhost:7860/health || exit 1

# Start command for Hugging Face - FIXED PORT
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]