We were unable to load Disqus. If you are a moderator please see our troubleshooting guide.

Nikola • 6 years ago

Hey, I know it's late answer, but someone may encounter the same problem mentioned above. Mainly, when CMD ["cron", "-f"] is run, it makes the Dockerfile stuck on that command because of the -f flag, and that's why we cannot access the system via browser. A solution would be the following:

Create your custom entrypoint.sh, something like this:


#!/bin/bash

cron -f &
docker-php-entrypoint php-fpm

Note the &, it means "send to background".

Then:

COPY ./entrypoint.sh /
ENTRYPOINT /entrypoint.sh

With that, we redefine our entry point of php-fpm, and since the cron starts as a background process, we can make it work simultaneously.
Source: https://stackoverflow.com/questions/44198700/getting-cron-to-run-on-php7-fpm-image#answer-44201082

Additionally, try running /usr/sbin/cron -f instead of cron -f, if the scheduled job still doesn't work.

Rafael Ambrosio • 5 years ago

Hey Nikola, you really saved me!
Thank you very much!