Spaces:
Sleeping
Sleeping
Tu Nombre commited on
Commit ·
f171afc
1
Parent(s): 92e1cf2
registrar montserrat en el sistema y usarla en subtitulos
Browse files- Dockerfile +5 -0
- Dockerfile_backup_0914 +28 -0
- app.py +1 -1
Dockerfile
CHANGED
|
@@ -16,6 +16,11 @@ RUN rm -f /etc/ImageMagick-6/policy.xml /etc/ImageMagick-7/policy.xml || true
|
|
| 16 |
WORKDIR /app
|
| 17 |
COPY . /app
|
| 18 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
# 5. Instalar dependencias de Python
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
|
|
|
| 16 |
WORKDIR /app
|
| 17 |
COPY . /app
|
| 18 |
|
| 19 |
+
# Registrar la fuente Montserrat en el sistema
|
| 20 |
+
RUN mkdir -p /usr/share/fonts/truetype/montserrat \
|
| 21 |
+
&& cp /app/Montserrat-Bold.ttf /usr/share/fonts/truetype/montserrat/ \
|
| 22 |
+
&& fc-cache -f -v
|
| 23 |
+
|
| 24 |
# 5. Instalar dependencias de Python
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
Dockerfile_backup_0914
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Usar imagen oficial de Python ligera
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# 2. Instalar dependencias del sistema (ImageMagick, ffmpeg y fuentes)
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
imagemagick \
|
| 7 |
+
ffmpeg \
|
| 8 |
+
fonts-liberation \
|
| 9 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
+
|
| 11 |
+
# Parche fuerte: vaciar la policy de ImageMagick (permite todo)
|
| 12 |
+
RUN rm -f /etc/ImageMagick-6/policy.xml /etc/ImageMagick-7/policy.xml || true
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
# 4. Configurar el directorio de trabajo
|
| 16 |
+
WORKDIR /app
|
| 17 |
+
COPY . /app
|
| 18 |
+
|
| 19 |
+
# 5. Instalar dependencias de Python
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# 6. Dar permisos totales para que el script pueda crear f.mp4, out.mp4, etc.
|
| 23 |
+
RUN chmod -R 777 /app
|
| 24 |
+
|
| 25 |
+
# 7. Exponer puerto de Hugging Face y arrancar
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 28 |
+
|
app.py
CHANGED
|
@@ -230,7 +230,7 @@ def montar_video(guion, archivos, subs=None, efecto="ninguno", material_escenas=
|
|
| 230 |
sub_pos = {"arriba":0.15,"centro":0.5,"abajo":0.78}.get(subs.get("posicion","abajo"),0.78)
|
| 231 |
sub_activo = subs.get("activo",True)
|
| 232 |
if sub_activo:
|
| 233 |
-
txts = [TextClip(t.upper(), fontsize=sub_size, color=sub_color, font="/
|
| 234 |
stroke_color="black", stroke_width=2, method="caption", size=(int(clip.w*0.8),None)
|
| 235 |
).set_start(i*t_f).set_duration(t_f).set_pos(("center",sub_pos), relative=True)
|
| 236 |
for i,t in enumerate(frases)]
|
|
|
|
| 230 |
sub_pos = {"arriba":0.15,"centro":0.5,"abajo":0.78}.get(subs.get("posicion","abajo"),0.78)
|
| 231 |
sub_activo = subs.get("activo",True)
|
| 232 |
if sub_activo:
|
| 233 |
+
txts = [TextClip(t.upper(), fontsize=sub_size, color=sub_color, font="/usr/share/fonts/truetype/montserrat/Montserrat-Bold.ttf",
|
| 234 |
stroke_color="black", stroke_width=2, method="caption", size=(int(clip.w*0.8),None)
|
| 235 |
).set_start(i*t_f).set_duration(t_f).set_pos(("center",sub_pos), relative=True)
|
| 236 |
for i,t in enumerate(frases)]
|