Can't run cron file with docker -compose what i can do?
I use Django and postgres to them, I wrote a script that scrapes data and writes to the database and another that dumps. And these scripts should run at a certain time, as if in the logs I see that it is raised, but when I run it, it does not work
PS C:\Users\komar\django-scraper-6> docker exec -it scrap bash root@0296ba2fb7f3:~/django_scraper# supervisorctl status cron RUNNING pid 9, uptime 0:09:37 server EXITED Feb 15 10:26 AM root@0296ba2fb7f3:~/django_scraper# supervisorctl start server server: started root@0296ba2fb7f3:~/django_scraper# supervisorctl status cron RUNNING pid 9, uptime 0:11:02 server EXITED Feb 15 10:37 AM
dockerfile
FROM python:latest
WORKDIR /root/django_scraper/
RUN apt-get update && apt-get install -y cron supervisor
COPY ./requirements.txt .
RUN pip install -r requirements.txt
COPY ./app ./app
COPY configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY configs/cronfile /etc/cron.d/cronfile
RUN crontab /etc/cron.d/cronfile
ENTRYPOINT /usr/bin/supervisord
cronfile
# START CRON JOB LIST
0 12 * * * python /root/django_scraper/app/scrap_file.py >> /tmp/postgres_dump.log 2>&1
0 13 * * * python /root/django_scraper/app/db_dump.py
# END CRON JOB LIST
my repo https://github.com/yurakomarnitskyi/django-scraper
dockerfile
FROM python:latest
WORKDIR /root/django_scraper/
RUN apt-get update && apt-get install -y cron supervisor
COPY ./requirements.txt .
RUN pip install -r requirements.txt
COPY ./app ./app
COPY configs/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY configs/cronfile /etc/cron.d/cronfile
RUN crontab /etc/cron.d/cronfile
ENTRYPOINT /usr/bin/supervisord
cronfile
# START CRON JOB LIST
0 12 * * * python /root/django_scraper/app/scrap_file.py >> /tmp/postgres_dump.log 2>&1
0 13 * * * python /root/django_scraper/app/db_dump.py
# END CRON JOB LIST
my repo: https://github.com/yurakomarnitskyi/django-scraper