Add schedule container
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Philipp Lang 2023-07-24 18:19:32 +02:00
parent 21ce8874f9
commit 1583e77756
4 changed files with 36 additions and 1 deletions

View File

@ -33,3 +33,12 @@ if [ $1 == "app" ]; then
fi
if [ $1 == "schedule" ]; then
wait_for_db
while true; do
su www-data -c 'php artisan schedule:run -n'
sleep 60
done
fi

View File

@ -28,6 +28,7 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
$schedule->command(PruneCommand::class, ['--hours' => 168])->daily(); // 168h = 7 Tage
$schedule->command(InitializeMembers::class)->dailyAt('03:00');
}
/**

View File

@ -66,7 +66,7 @@ return [
|
*/
'timezone' => 'UTC',
'timezone' => 'Europe/Berlin',
/*
|--------------------------------------------------------------------------

View File

@ -50,6 +50,31 @@ services:
XELATEX_BIN: /usr/bin/xelatex
PDFLATEX_BIN: /usr/bin/pdflatex
REDIS_HOST: redis
volumes:
- ./data/storage:/app/storage/app
- ./cookies:/app/packages/laravel-nami/.cookies
schedule:
build:
context: .
dockerfile: ./.docker/php.Dockerfile
depends_on:
- db
- php
command: /bin/entrypoint schedule
env_file:
- .app.env
environment:
DB_HOST: db
DB_DATABASE: db
DB_USERNAME: db
QUEUE_CONNECTION: redis
XELATEX_BIN: /usr/bin/xelatex
PDFLATEX_BIN: /usr/bin/pdflatex
REDIS_HOST: redis
volumes:
- ./data/storage:/app/storage/app
- ./cookies:/app/packages/laravel-nami/.cookies
db:
image: mariadb:10.6.5