21 lines
453 B
Docker
21 lines
453 B
Docker
FROM python:latest
|
|
RUN apt-get update && apt-get install -y cron
|
|
|
|
WORKDIR ./
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
# Copia el archivo crontab al contenedor
|
|
COPY crontab.txt /etc/cron.d/my_cron_job
|
|
|
|
# Asigna los permisos adecuados
|
|
RUN chmod 0644 /etc/cron.d/my_cron_job
|
|
|
|
# Asegura que el archivo se procese por cron
|
|
RUN touch /var/log/cron.log && chmod 0666 /var/log/cron.log
|
|
|
|
|
|
CMD ["sh", "-c", "cron -f"]
|