Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cron not working for scheduler in Laravel app (different container) #33

Open
khushbupatel24 opened this issue Dec 30, 2019 · 0 comments

Comments

@khushbupatel24
Copy link

khushbupatel24 commented Dec 30, 2019

I pulled your image and tried to configure cron to run laravel scheduler. To test the setup, I am logging message through scheduler but it is not working.

Here is the configuration I did -

docker-compose.yml -


-Cron-job container
cron:
build:
context: ./crontab
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- app-network

-PHP Service - laravel project container
app:
build:
context: .
dockerfile: Dockerfile
image: digitalocean.com/php
container_name: app
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: app
SERVICE_TAGS: dev
working_dir: /var/www
volumes:
- ./:/var/www
- ./php/local.ini:/usr/local/etc/php/conf.d/local.ini
networks:
- app-network

-Docker Networks
networks:
app-network:
driver: bridge


Crontab (directory - cron configuration)

config.json -

[{ "comment":"cron with triggered commands", "schedule":"* * * * *", "command":"php /var/www/artisan schedule:run >> /dev/null 2>&1", "project":"paula", "container":"app" }]

Dockerfile -

`FROM willfarrell/crontab

COPY config.json ${HOME_DIR}/

Please help me with this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant