FROM python:3.12-slim | |
RUN apt-get update && apt-get install -y \ | |
libsndfile1-dev \ | |
build-essential \ | |
libopenblas-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Crear y configurar un usuario no root | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
WORKDIR $HOME/app | |
ENV HF_HOME=$HOME/.cache | |
COPY --chown=user . $HOME/app | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |