diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..f505d47 --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/crontab.txt b/crontab.txt index 6900874..7935aee 100644 --- a/crontab.txt +++ b/crontab.txt @@ -1 +1 @@ -0 1 * * * python3 /app/main.py >> /var/log/cron.log 2>&1 #modificar para ajustar \ No newline at end of file +0 1 * * * python3 /app/main.py >> /var/log/cron.log 2>&1