Update Dockerfile
Browse files- Dockerfile +14 -26
Dockerfile
CHANGED
|
@@ -1,45 +1,33 @@
|
|
| 1 |
-
|
| 2 |
-
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-devel
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
-
ENV PYTHONUNBUFFERED=1
|
| 7 |
-
|
| 8 |
-
# Instalar dependencias del sistema
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
ffmpeg \
|
| 11 |
-
libsndfile1-dev \
|
| 12 |
git \
|
| 13 |
-
wget \
|
| 14 |
-
curl \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
-
# Crear usuario
|
| 18 |
RUN useradd -m -u 1000 user
|
| 19 |
-
|
| 20 |
-
# Instalar Demucs y dependencias como root primero
|
| 21 |
-
RUN pip install --no-cache-dir \
|
| 22 |
-
gradio==4.44.0 \
|
| 23 |
-
demucs \
|
| 24 |
-
librosa \
|
| 25 |
-
soundfile \
|
| 26 |
-
numpy
|
| 27 |
-
|
| 28 |
-
# Pre-descargar modelos para que est茅n listos
|
| 29 |
-
RUN python -c "import demucs.api; demucs.api.Separator(model='htdemucs')" || echo "Modelo se descargar谩 en primera ejecuci贸n"
|
| 30 |
-
|
| 31 |
-
# Cambiar a usuario user
|
| 32 |
USER user
|
| 33 |
|
| 34 |
-
# Configurar paths
|
| 35 |
ENV HOME=/home/user \
|
| 36 |
PATH=/home/user/.local/bin:$PATH
|
| 37 |
|
| 38 |
WORKDIR $HOME/app
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
# Copiar archivos
|
| 41 |
COPY --chown=user:user . .
|
| 42 |
|
| 43 |
EXPOSE 7860
|
| 44 |
-
|
| 45 |
CMD ["python", "app.py"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
|
|
|
| 2 |
|
| 3 |
+
# Instalar dependencias b谩sicas del sistema
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg \
|
|
|
|
| 6 |
git \
|
|
|
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# Crear usuario
|
| 10 |
RUN useradd -m -u 1000 user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
USER user
|
| 12 |
|
|
|
|
| 13 |
ENV HOME=/home/user \
|
| 14 |
PATH=/home/user/.local/bin:$PATH
|
| 15 |
|
| 16 |
WORKDIR $HOME/app
|
| 17 |
|
| 18 |
+
# Instalar solo lo esencial
|
| 19 |
+
RUN pip install --no-cache-dir --user \
|
| 20 |
+
gradio==4.44.0 \
|
| 21 |
+
huggingface_hub \
|
| 22 |
+
transformers \
|
| 23 |
+
torch \
|
| 24 |
+
torchaudio \
|
| 25 |
+
librosa \
|
| 26 |
+
soundfile \
|
| 27 |
+
numpy
|
| 28 |
+
|
| 29 |
# Copiar archivos
|
| 30 |
COPY --chown=user:user . .
|
| 31 |
|
| 32 |
EXPOSE 7860
|
|
|
|
| 33 |
CMD ["python", "app.py"]
|