File size: 723 Bytes
b133c40
 
4dd818d
94618a9
4dd818d
 
94618a9
4dd818d
 
94618a9
4dd818d
 
 
 
94618a9
4dd818d
 
 
 
 
 
 
94618a9
4dd818d
 
94618a9
4dd818d
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
# 1. Use Python 3.12 to satisfy the 'perception-models' requirement
FROM python:3.12

# 2. Set the working directory
WORKDIR /code

# 3. Install system dependencies (ffmpeg is required for audio)
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*

# 4. Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

# 5. Set up a user (Required by HF Spaces security)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# 6. Copy application files
COPY --chown=user . $HOME/app

# 7. Start the app
CMD ["python", "app.py"]