Add schedule container
This commit is contained in:
parent
21ce8874f9
commit
1583e77756
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -66,7 +66,7 @@ return [
|
|||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
'timezone' => 'Europe/Berlin',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue