I've deployed a docker image to my Heroku app, the dockerfile looks like this
FROM python:3.11
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
RUN pip install .
CMD ["python3", "application/scheduler.py"]
The goal here was to start the image and run the scheduler task, then I've got a Heroku scheduler that's due to run once every hour on the hour. The problem is, the dyno doesn't seem to be booting. The image is quite large (about 9GB), so I'm thinking maybe it's just running the start task for too long, and Heroku is trying to reset the dyno, causing it to get stuck in an infinite loop of stopping and starting.
2023-08-21T09:10:35.278311+00:00 heroku[clock.1]: State changed from starting to down
2023-08-21T09:10:35.281084+00:00 heroku[clock.1]: State changed from down to starting
2023-08-21T09:11:05.028368+00:00 app[api]: Starting process with command `python3 application/scheduler.py` by user [email protected]
2023-08-21T09:11:17.405811+00:00 app[api]: Release v9 created by user [REDACTED]
2023-08-21T09:11:17.405811+00:00 app[api]: Deployed worker (524f22e3d748) by user [REDACTED]
2023-08-21T09:11:17.677164+00:00 heroku[clock.1]: Restarting
2023-08-21T09:13:20.910308+00:00 heroku[scheduler.9474]: State changed from starting to complete
2023-08-21T09:13:20.958179+00:00 heroku[clock.1]: State changed from starting to down
2023-08-21T09:13:20.960596+00:00 heroku[clock.1]: State changed from down to starting
2023-08-21T09:15:36.468487+00:00 heroku[clock.1]: State changed from starting to down
2023-08-21T09:15:36.472387+00:00 heroku[clock.1]: State changed from down to starting
2023-08-21T09:17:52.039661+00:00 heroku[clock.1]: State changed from starting to down
2023-08-21T09:17:52.044659+00:00 heroku[clock.1]: State changed from down to starting
The Procfile is simply:
clock: python3 application/scheduler.py
Wondering if there's a way to stop the dyno from doing this, or whether I'd be better off looking for another solution outside of Heroku?