Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +23 -16
Dockerfile
CHANGED
|
@@ -1,23 +1,30 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
&& apt-get clean \
|
| 8 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
| 11 |
-
RUN pip install fastapi uvicorn
|
| 12 |
-
|
| 13 |
-
# Copia los archivos de la aplicación al contenedor
|
| 14 |
COPY . /app
|
| 15 |
|
| 16 |
-
#
|
|
|
|
|
|
|
|
|
|
| 17 |
WORKDIR /app
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
-
# Comando para ejecutar
|
| 23 |
-
CMD ["python", "
|
|
|
|
| 1 |
+
# Usa la imagen base de Debian estable
|
| 2 |
+
FROM debian:stable
|
| 3 |
|
| 4 |
+
# Define el usuario root y configura el frontend de APT para evitar prompts interactivos
|
| 5 |
+
USER root
|
| 6 |
+
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
|
|
| 7 |
|
| 8 |
+
# Copia todos los archivos del contexto actual al directorio /app en el contenedor
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY . /app
|
| 10 |
|
| 11 |
+
# Da permisos a todos los archivos en /app
|
| 12 |
+
RUN chmod -R 777 /app
|
| 13 |
+
|
| 14 |
+
# Define el directorio de trabajo como /app
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
+
# Actualiza los paquetes e instala ffmpeg y Python 3 con pip y venv
|
| 18 |
+
RUN apt-get update && apt-get install -y ffmpeg python3 python3-pip python3-venv
|
| 19 |
+
|
| 20 |
+
# Crea un entorno virtual para Python
|
| 21 |
+
RUN python3 -m venv /app/venv
|
| 22 |
+
|
| 23 |
+
# Instala las dependencias de Python necesarias en el entorno virtual
|
| 24 |
+
RUN /app/venv/bin/pip install fastapi uvicorn watchdog
|
| 25 |
+
|
| 26 |
+
# Copia el script de Python para la transmisión
|
| 27 |
+
COPY stream_audio.py /app/stream_audio.py
|
| 28 |
|
| 29 |
+
# Comando para ejecutar el script de transmisión de audio
|
| 30 |
+
CMD ["/app/venv/bin/python", "/app/stream_audio.py"]
|