Skip to content

Commit

Permalink
something aint working
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjustesen committed Aug 29, 2023
1 parent 889c7b7 commit 4a11985
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Cron\CronExpression;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Illuminate\Support\Facades\Log;

class Kernel extends ConsoleKernel
{
Expand Down Expand Up @@ -50,6 +51,10 @@ protected function schedule(Schedule $schedule): void

return $cron->isDue();
});

$schedule->call(function () {
Log::info('The scheduler ran.');
});
}

/**
Expand Down
5 changes: 3 additions & 2 deletions docker/8.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV TZ=UTC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

RUN apt-get update \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch \
&& apt-get install -y gnupg gosu curl ca-certificates zip unzip git supervisor sqlite3 libcap2-bin libpng-dev python2 dnsutils librsvg2-bin fswatch cron \
&& curl -sS 'https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x14aa40ec0831756756d7f66c4f4ea0aae5267a6c' | gpg --dearmor | tee /etc/apt/keyrings/ppa_ondrej_php.gpg > /dev/null \
&& echo "deb [signed-by=/etc/apt/keyrings/ppa_ondrej_php.gpg] https://ppa.launchpadcontent.net/ondrej/php/ubuntu jammy main" > /etc/apt/sources.list.d/ppa_ondrej_php.list \
&& apt-get update \
Expand All @@ -40,7 +40,8 @@ RUN apt-get update \
&& apt-get install -y speedtest \
&& apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& echo "MAILTO=\"\"\n* * * * * sail /usr/bin/php /var/www/html/artisan schedule:run" > /etc/cron.d/laravel

RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2

Expand Down
7 changes: 7 additions & 0 deletions docker/8.2/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ user=root
logfile=/var/log/supervisor/supervisord.log
pidfile=/var/run/supervisord.pid

[program:cron]
command=/usr/sbin/cron -f -l 8
user=root
autostart=true
stdout_logfile=/var/log/cron.out.log
stderr_logfile=/var/log/cron.err.log

[program:php]
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan serve --host=0.0.0.0 --port=80
user=sail
Expand Down

0 comments on commit 4a11985

Please sign in to comment.