Starting the Laravel scheduler / cron from serversideup/docker-php image

Hi @fideloper-fly I have moved to your S6 approach.

Here is my implementation, can you comment ?

I created queue and cron files in the docker folder as you suggested in this post

my copy logic :::

COPY . /var/www/html

RUN composer install --optimize-autoloader --no-dev \
    && mkdir -p storage/logs \
    && php artisan optimize:clear \
    && chown -R webuser:webgroup /var/www/html \
    && sed -i 's/protected \$proxies/protected \$proxies = "*"/g' app/Http/Middleware/TrustProxies.php \
    && echo "MAILTO=\"\"\n* * * * * webuser /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel \
    && rm -rf /etc/cont-init.d/* \
    && cp docker/queue /etc/services.d/queue \
    && cp docker/cron /etc/services.d/cron \
    && chmod +x /etc/services.d/queue \
    && chmod +x /etc/services.d/cron \
    && cp docker/nginx-websockets.conf /etc/nginx/conf.d/websockets.conf \
    && cp docker/nginx-default /etc/nginx/sites-available/default \
    && cp docker/entrypoint.sh /entrypoint \
    && chmod +x /entrypoint

Sanity check on server:

webuser@5c3aac95:/etc/services.d$ ls -l
total 16
-rwxr-xr-x 1 root root   38 Aug 17 05:32 cron
drwxr-xr-x 2 root root 4096 Aug 16 08:13 nginx
drwxr-xr-x 2 root root 4096 Aug 16 08:12 php-fpm
-rwxr-xr-x 1 root root   87 Aug 17 05:32 queue

I don’t observe any log messages pertaining to a running queue nor any evidence of my test jobs have run.

if it helps :::

webuser@42917438:~/storage/app$ ps -eaf | grep s6
root       515     1  0 06:37 ?        00:00:00 s6-svscan -t0 /var/run/s6/services
root       571   515  0 06:37 ?        00:00:00 s6-supervise s6-fdholderd
root       725   515  0 06:37 ?        00:00:00 s6-supervise nginx
root       726   515  0 06:37 ?        00:00:00 s6-supervise php-fpm
webuser    763   754  0 06:57 pts/0    00:00:00 grep s6

and additionally if it helps…

webuser@42917438:/etc/cron.d$ service cron status
 * cron is not running