Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/razonyang/docker-php-cron
PHP Cron Docker Image
https://github.com/razonyang/docker-php-cron
cron cronjob crontab docker image php php-cron
Last synced: 20 days ago
JSON representation
PHP Cron Docker Image
- Host: GitHub
- URL: https://github.com/razonyang/docker-php-cron
- Owner: razonyang
- License: bsd-3-clause
- Created: 2019-08-09T06:12:41.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-03-28T02:32:30.000Z (over 4 years ago)
- Last Synced: 2024-04-14T00:22:48.786Z (7 months ago)
- Topics: cron, cronjob, crontab, docker, image, php, php-cron
- Language: Dockerfile
- Homepage:
- Size: 2.93 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
PHP Cron Docker Image
=====================Tags
----- razonyang/php-cron:7.4(latest)
- razonyang/php-cron:7.3
- razonyang/php-cron:7.2Usage
-----### Docker run
```shell
$ docker run --name php-cron razonyang/php-cron:latest
```Verify:
```shell
$ docker exec php-cron tail -f /tmp/cron.log
2019-08-09 06:28:01
2019-08-09 06:29:01
2019-08-09 06:30:01
2019-08-09 06:31:01
2019-08-09 06:32:01
```Custom configuration
```shell
$ docker run --name php-cron \
-v /your/crontab:/etc/crontab:ro razonyang/php-cron:latest \
/bin/bash -c "/usr/bin/crontab /etc/crontab && /usr/sbin/cron -f"
```We MUST apply the new `crontab` before starting `cron` service.
### Docker compose
`docker-compose.yml`
```yml
services:
cron:
image: razonyang/php-cron:latest
restart: always
volumes:
- ./crontab:/etc/crontab:ro
command: bash -c "/usr/bin/crontab /etc/crontab && /usr/sbin/cron -f"
```