From 3b8bec09541bdf799e4dac048e6f4159e7bf593c Mon Sep 17 00:00:00 2001 From: Leonardo Lemos Date: Sun, 28 Jan 2024 11:51:51 -0300 Subject: [PATCH] add cron to documentation --- README.md | 2 +- public/index.php | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 714fe39..09b3119 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ docker build -t easycron . 4. Now we just need to execute the cron command: ``` -docker run -rm easycron crond -l 2 -f +docker run --rm easycron crond -l 2 -f ``` ### Changelog diff --git a/public/index.php b/public/index.php index 96fde66..df81393 100644 --- a/public/index.php +++ b/public/index.php @@ -204,7 +204,52 @@ - ./local-path-to-config/new-default.conf:/etc/nginx/http.d/default.conf ports: - 80:80 - + +

How to Cron

+ +
+
+ +

+ 1. The image contains the cron binary then lets take a look how easy would be to spawn the Laravel Scheduler for example: +

+ +
+
+* * * * * php /var/www/app/artisan schedule:run
+            
+ +

+ 2. Second step would be place the crontab file on the default cron directory: +

+ +
+
+FROM convenia/php-full:8.3
+
+ADD . /var/www/app
+
+COPY crontab /etc/crontabs/root
+            
+ +

+ 3. Build the image: +

+ +
+
+docker build -t easycron .
+            
+ +

+ 4. Now we just need to execute the cron command: +

+ +
+
+docker run --rm easycron crond -l 2 -f
+            
+

Bugs, and suggestion