37 lines
1.2 KiB
Docker
37 lines
1.2 KiB
Docker
# Usar imagen base UBI9 de Python de Red Hat
|
|
FROM registry.access.redhat.com/ubi9/python-39:latest
|
|
|
|
USER 0
|
|
WORKDIR /app
|
|
|
|
# Instalar EPEL.
|
|
# Luego, intentar instalar SDL2-devel (que debería traer SDL2 runtime)
|
|
# y después el resto de las dependencias y ffmpeg-free.
|
|
# Los repositorios UBI BaseOS, AppStream y CodeReadyBuilder están habilitados por defecto.
|
|
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
|
|
dnf makecache && \
|
|
# Intentar instalar SDL2-devel. Esto debería traer SDL2 como dependencia.
|
|
# Si SDL2-devel no se encuentra, entonces el problema es más profundo con EPEL/UBI para SDL2.
|
|
dnf install -y SDL2-devel gcc-c++ make ffmpeg-free && \
|
|
dnf clean all && \
|
|
rm -rf /var/cache/dnf /var/log/dnf*
|
|
|
|
# Copiar archivos de la aplicación
|
|
COPY requirements.txt .
|
|
|
|
# Instalar dependencias de Python
|
|
RUN pip install --default-timeout=300 --no-cache-dir -r requirements.txt
|
|
|
|
# Copiar código de la aplicación
|
|
COPY app.py .
|
|
|
|
# Crear directorios y establecer permisos
|
|
RUN mkdir -p /app/shared /app/output && \
|
|
chgrp -R 0 /app && \
|
|
chmod -R g+rwx /app
|
|
|
|
# Volver al usuario predeterminado
|
|
USER 1001
|
|
|
|
# Comando para iniciar la aplicación
|
|
CMD ["python", "app.py"] |