Spaces:
Running
Running
| FROM python:3.11-slim | |
| # Library tambahan agar librosa dapat membaca berbagai format audio | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| libsndfile1 && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Hugging Face Docker Spaces berjalan dengan user ID 1000 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PYTHONUNBUFFERED=1 | |
| WORKDIR $HOME/app | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir \ | |
| --upgrade pip && \ | |
| pip install --no-cache-dir \ | |
| -r requirements.txt | |
| COPY --chown=user . . | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |