Skip to content

Commit

Permalink
add cron to documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jleonardolemos committed Jan 28, 2024
1 parent a3e4c54 commit 3b8bec0
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 46 additions & 1 deletion public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,52 @@
- ./local-path-to-config/new-default.conf:/etc/nginx/http.d/default.conf
ports:
- 80:80</pre>


<p class="p-title"><strong>How to Cron</strong></p>

<div class="division-bar">
</div>

<p>
1. The image contains the cron binary then lets take a look how easy would be to spawn the <a href="https://laravel.com/docs/10.x/scheduling">Laravel Scheduler</a> for example:
</p>

<pre class="button code">

* * * * * php /var/www/app/artisan schedule:run
</pre>

<p>
2. Second step would be place the crontab file on the default cron directory:
</p>

<pre class="button code">

FROM convenia/php-full:8.3

ADD . /var/www/app

COPY crontab /etc/crontabs/root
</pre>

<p>
3. Build the image:
</p>

<pre class="button code">

docker build -t easycron .
</pre>

<p>
4. Now we just need to execute the cron command:
</p>

<pre class="button code">

docker run --rm easycron crond -l 2 -f
</pre>

<p class="p-title"><strong>Bugs, and suggestion</strong></p>

<div class="division-bar">
Expand Down

0 comments on commit 3b8bec0

Please sign in to comment.