File size: 1,267 Bytes
5689bfc
 
 
 
 
 
 
 
 
 
7bc6626
5689bfc
 
 
7bc6626
5689bfc
 
 
 
 
 
 
 
 
 
9da90a3
5689bfc
 
 
 
 
 
9da90a3
5689bfc
 
 
 
 
 
 
 
 
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
# Dockerfile for Hugging Face Spaces deployment
# Uses Python 3.11 with system dependencies for audio processing

FROM python:3.11-slim

WORKDIR /app

# Install system dependencies for audio processing
# ffmpeg: for audio format conversion
# libsndfile1: for soundfile library to read/write audio files
# build-essential: for compiling webrtcvad (includes gcc, g++, make)
RUN apt-get update && apt-get install -y \
    ffmpeg \
    libsndfile1 \
    build-essential \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements file first (for better Docker layer caching)
COPY requirements.txt .

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

# Copy application code
COPY app.py .
COPY wav2vec2-ravdess-emotion ./wav2vec2-ravdess-emotion

# Hugging Face Spaces provides PORT environment variable (default: 7860)
# Our app.py already reads from PORT env var, so no changes needed
ENV PORT=7860

# Set Hugging Face cache directory to writable location
# Note: TRANSFORMERS_CACHE is deprecated, using HF_HOME only
ENV HF_HOME=/tmp/huggingface_cache

# Expose the port (Hugging Face Spaces uses 7860 by default)
EXPOSE 7860

# Run the FastAPI application
# The app.py already uses PORT from environment variable
CMD ["python", "app.py"]