This commit is contained in:
Your Name
2025-02-07 23:26:06 +01:00
2 changed files with 19 additions and 1 deletions

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
# Usa una imagen oficial de Python
FROM python:3.9
# Configurar el directorio de trabajo en el contenedor
WORKDIR /app
# Copiar los archivos de la aplicación al contenedor
COPY app/ /app/
# Instalar dependencias si es necesario (ajusta según tu requerimiento)
RUN pip install mysql-connector-python schedule
# Copiar el archivo de crontab y configurarlo
COPY crontab.txt /etc/cron.d/crontab
RUN chmod 0644 /etc/cron.d/crontab && crontab /etc/cron.d/crontab
# Iniciar cron y ejecutar el script en segundo plano
CMD cron && tail -f /var/log/cron.log

View File

@ -1 +1 @@
0 1 * * * python3 /app/main.py >> /var/log/cron.log 2>&1 #modificar para ajustar
0 1 * * * python3 /app/main.py >> /var/log/cron.log 2>&1