File size: 621 Bytes
4e9e7ec
 
 
4867aa1
4e9e7ec
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg libsndfile1 git \
    && rm -rf /var/lib/apt/lists/*

# HF Spaces sets HOME=/home/user for non-root user. Use that for caches.
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    HF_HOME=/home/user/.cache/huggingface \
    PORT=7860

WORKDIR /home/user/app
COPY --chown=user:user requirements.txt .
RUN pip install --user --no-cache-dir -r requirements.txt

COPY --chown=user:user app.py .
COPY --chown=user:user static/ ./static/

EXPOSE 7860
CMD ["python", "app.py"]