File size: 1,126 Bytes
80d2041
920c4ed
 
4f9f121
920c4ed
23e38e4
80d2041
 
920c4ed
4f9f121
 
 
 
920c4ed
 
 
 
 
 
23e38e4
920c4ed
 
80d2041
4f9f121
 
920c4ed
80d2041
4f9f121
920c4ed
80d2041
920c4ed
 
80d2041
920c4ed
 
951c1da
 
 
 
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
# Use a stable Python 3.11 base image
FROM python:3.11-slim

# Set environment variables for compatibility
ENV PYTHONUNBUFFERED=1 \
    DEBIAN_FRONTEND=noninteractive \
    TF_ENABLE_ONEDNN_OPTS=0 \
    TF_CPP_MIN_LOG_LEVEL=2

# Set the working directory
WORKDIR /app

# Install system dependencies, including FFmpeg, as root
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libgomp1 \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Copy and install Python requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Create necessary directories for the app to function
RUN mkdir -p /app/captured_images /app/temp_audio

# Expose the port required by Hugging Face Spaces
EXPOSE 7860

# --- PRODUCTION SERVER COMMAND ---
# Use Gunicorn to run the app instead of Flask's development server
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "3", "--timeout", "120", "app:app"]
# ---------------------------------