Refactor Dockerfiles to use UBI9 base image and update dependencies
This commit is contained in:
@@ -1,11 +1,35 @@
|
||||
FROM python:3.9-slim
|
||||
# Usar imagen base UBI9 de Python de Red Hat
|
||||
FROM registry.access.redhat.com/ubi9/python-39:latest
|
||||
|
||||
# Usuario por defecto en las imágenes UBI es no-root (default)
|
||||
USER 0
|
||||
|
||||
# Establecer directorio de trabajo
|
||||
WORKDIR /app
|
||||
|
||||
# Instalar dependencias
|
||||
RUN apt-get update && apt-get install -y ffmpeg
|
||||
RUN pip install pika pydub
|
||||
# Instalar ffmpeg usando el gestor de paquetes de Red Hat (dnf)
|
||||
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
|
||||
dnf install -y ffmpeg && \
|
||||
dnf clean all
|
||||
|
||||
# Copiar archivos de la aplicación
|
||||
COPY requirements.txt .
|
||||
|
||||
# Instalar dependencias de Python
|
||||
# Las imágenes UBI de Python utilizan pip-install en lugar de pip directamente
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copiar código de la aplicación
|
||||
COPY app.py .
|
||||
|
||||
# Crear directorio compartido y configurar permisos adecuados para OpenShift
|
||||
RUN mkdir -p /app/shared && \
|
||||
chmod -R 775 /app && \
|
||||
chgrp -R 0 /app && \
|
||||
chmod -R g=u /app
|
||||
|
||||
# Volver al usuario predeterminado de la imagen UBI (no-root)
|
||||
USER default
|
||||
|
||||
# Comando para iniciar la aplicación
|
||||
CMD ["python", "app.py"]
|
||||
2
splitter/requirements.txt
Normal file
2
splitter/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
pika==1.3.2
|
||||
pydub==0.25.1
|
||||
Reference in New Issue
Block a user