forked from TDTP/pantallas-led
update container format, now it runs the process to create bus poster and then it delete automatically
parent
1261cadadb
commit
b1418985f7
13
Dockerfile
13
Dockerfile
|
@ -6,15 +6,10 @@ WORKDIR /app
|
|||
|
||||
# Copia el archivo requirements.txt al contenedor
|
||||
COPY requirements.txt requirements.txt
|
||||
COPY app.py app.py
|
||||
|
||||
# Instala las dependencias
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install -r requirements.txt --no-cache-dir
|
||||
|
||||
# Copia el archivo de configuración de Jupyter
|
||||
COPY jupyter_notebook_config.py /root/.jupyter/
|
||||
|
||||
# Expone el puerto 8888 para Jupyter Notebook
|
||||
EXPOSE 8888
|
||||
|
||||
# Ejecuta Jupyter Notebook cuando el contenedor se inicie
|
||||
CMD ["jupyter", "notebook", "--ip=0.0.0.0", "--port=8888", "--no-browser", "--allow-root"]
|
||||
# Ejecuta app.py
|
||||
CMD ["python", "app.py"]
|
||||
|
|
2
app.py
2
app.py
|
@ -154,7 +154,7 @@ def main():
|
|||
full_panel.add_image(poster2, (aprox((0.05)*width), aprox((0.5)*height)))
|
||||
# full_panel.add_image(bm, (aprox(0.02*width),aprox((1/6)*height)))
|
||||
full_panel.get_image()
|
||||
full_panel.save_image('/app/data/output.png')
|
||||
full_panel.save_image('/app/data/output/images/poster.png')
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
BIN
data/output.png
BIN
data/output.png
Binary file not shown.
Before Width: | Height: | Size: 8.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.4 KiB |
|
@ -1,5 +1,4 @@
|
|||
matplotlib
|
||||
seaborn
|
||||
plotly
|
||||
opencv-python
|
||||
jupyter
|
||||
requests
|
||||
Pillow
|
||||
numpy
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Rutas absolutas a las carpetas locales
|
||||
project_folder_path=$(pwd)
|
||||
data_path=$project_folder_path/data
|
||||
scripts_path=$project_folder_path/scripts
|
||||
assets_path=$project_folder_path/assets
|
||||
|
||||
|
||||
|
||||
# Ejecuta el contenedor con el enlace de carpeta local
|
||||
docker run --rm -d -p 8888:8888 --name make_poster -v $data_path:/app/data -v $assets_path:/app/assets -v $scripts_path:/app/scripts bus_poster
|
|
@ -5,7 +5,7 @@ from PIL import ImageDraw, ImageFont
|
|||
from PIL import Image, ImageDraw, ImageFont
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from MyDraw import MyDraw
|
||||
from .MyDraw import MyDraw
|
||||
|
||||
class BusPoster(MyDraw):
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ class MyDraw():
|
|||
|
||||
def load_barlow(self, font_size=None):
|
||||
# Ruta a la fuente TTF personalizada
|
||||
font_path = "/app/data/Barlow-Medium.ttf"
|
||||
font_path = "/app/assets/fonts/Barlow-Medium.ttf"
|
||||
# Carga la fuente
|
||||
if font_size is None:
|
||||
self.font = ImageFont.truetype(font_path, self.prms['font_size'])
|
||||
|
|
|
@ -5,7 +5,7 @@ from PIL import ImageDraw, ImageFont
|
|||
from PIL import Image, ImageDraw, ImageFont
|
||||
import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
from MyDraw import MyDraw
|
||||
from .MyDraw import MyDraw
|
||||
|
||||
class TimeAnnouncement(MyDraw):
|
||||
|
||||
|
|
Loading…
Reference in New Issue