Spaces:
Running
Running
File size: 866 Bytes
7a70cae f8b105b 0624bf6 83e37e7 0624bf6 f8b105b 83e37e7 7a70cae 83e37e7 f8b105b 7a70cae 83e37e7 7a70cae | 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 | FROM python:3.11-slim
# Install system deps for audio processing
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/*
# Create non-root user (HF Spaces requirement)
RUN useradd -m -u 1000 user
# Create dirs BEFORE switching user
RUN mkdir -p /home/user/app/checkpoints /home/user/app/data/training_data /home/user/app/logs && chown -R user:user /home/user/app
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH PYTHONUNBUFFERED=1 PYTHONIOENCODING=UTF-8 HF_HOME=/home/user/.cache/huggingface PORT=7860
WORKDIR /home/user/app
# Install Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt && pip install --no-cache-dir soundfile
COPY . .
USER user
CMD ["python", "app.py"]
|