From 98e41ad73b204331879384858e52422b22272537 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 5 Jan 2021 11:02:57 +1100 Subject: [PATCH] Rework crons --- config/cron.sh | 16 ++++++++++++++++ docker-compose.yml | 16 ++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) create mode 100755 config/cron.sh diff --git a/config/cron.sh b/config/cron.sh new file mode 100755 index 0000000..c951c66 --- /dev/null +++ b/config/cron.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +echo "Early Entry" + +cleanup () +{ + kill -s SIGTERM $! + exit 0 +} + +trap cleanup SIGINT SIGTERM + +while : +do + sleep 60 ; cd /var/www/app/ && php artisan schedule:run; +done diff --git a/docker-compose.yml b/docker-compose.yml index 20321a4..c9b2aff 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,6 @@ services: # Vhost configuration #- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com - ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro - # Configure your mounted directories, make sure the folder 'public' and 'storage' - # exist, before mounting them # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data! - ./docker/app/public:/var/www/app/public:rw,delegated - ./docker/app/storage:/var/www/app/storage:rw,delegated @@ -19,7 +17,7 @@ services: # Run webserver nginx on port 80 # Feel free to modify depending what port is already occupied ports: - - "8003:80" + - "80:80" #- "443:443" networks: - invoiceninja @@ -70,19 +68,13 @@ services: - ./config/hosts:/etc/hosts:ro - ./docker/app/public:/var/www/app/public:rw,delegated - ./docker/app/storage:/var/www/app/storage:rw,delegated - entrypoint: | - /bin/sh -c 'sh -s <