Spaces:
Sleeping
Sleeping
JairoDanielMT
commited on
Commit
•
79d058c
1
Parent(s):
67002a7
Update Dockerfile
Browse files- Dockerfile +20 -19
Dockerfile
CHANGED
@@ -1,16 +1,24 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.10
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
#
|
8 |
RUN pip install git+https://github.com/m-bain/whisperx.git
|
9 |
|
10 |
-
#
|
11 |
-
|
|
|
|
|
|
|
|
|
12 |
|
13 |
-
#
|
14 |
RUN apt-get update && apt-get install -y \
|
15 |
curl \
|
16 |
git \
|
@@ -20,19 +28,12 @@ RUN apt-get update && apt-get install -y \
|
|
20 |
git-lfs \
|
21 |
ffmpeg
|
22 |
|
23 |
-
#
|
24 |
-
COPY . /app
|
25 |
-
# copiar todos los archivos de la aplicación
|
26 |
-
|
27 |
-
COPY . .
|
28 |
-
# establecer directorio de trabajo
|
29 |
WORKDIR /app
|
|
|
30 |
|
31 |
-
#
|
32 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
33 |
-
|
34 |
-
# cambiar permisos de archivos necesarios
|
35 |
RUN chmod -R 777 /app
|
36 |
|
37 |
-
#
|
38 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
1 |
+
# Etapa 1: Instalación de dependencias de Python y construcción de la aplicación
|
2 |
+
FROM python:3.10 AS builder
|
3 |
|
4 |
+
# Copiar archivos de la aplicación
|
5 |
+
WORKDIR /app
|
6 |
+
COPY . .
|
7 |
+
|
8 |
+
# Instalar dependencias de Python
|
9 |
+
RUN pip install --no-cache-dir pandas numpy nltk moviepy pydub transformers pydantic pytest fastapi uvicorn torch torchvision torchaudio
|
10 |
|
11 |
+
# Instalar paquete especial whisperx desde GitHub
|
12 |
RUN pip install git+https://github.com/m-bain/whisperx.git
|
13 |
|
14 |
+
# Instalar dependencias desde requirements.txt
|
15 |
+
COPY requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
+
|
18 |
+
# Etapa 2: Agregar componentes específicos de CUDA y utilidades básicas
|
19 |
+
FROM nvidia/cuda:11.3.1-base-ubuntu20.04 AS final
|
20 |
|
21 |
+
# Instalar utilidades básicas
|
22 |
RUN apt-get update && apt-get install -y \
|
23 |
curl \
|
24 |
git \
|
|
|
28 |
git-lfs \
|
29 |
ffmpeg
|
30 |
|
31 |
+
# Copiar la aplicación desde la etapa anterior
|
|
|
|
|
|
|
|
|
|
|
32 |
WORKDIR /app
|
33 |
+
COPY --from=builder /app .
|
34 |
|
35 |
+
# Cambiar permisos de archivos necesarios
|
|
|
|
|
|
|
36 |
RUN chmod -R 777 /app
|
37 |
|
38 |
+
# Definir comando predeterminado para iniciar la aplicación
|
39 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|