Hello,
I’m trying to setup scheduled tasks for Laravel. I did follow this guide: https://docs.digitalocean.com/developer-center/how-to-setup-a-job-scheduler-on-digitalocean-app-platform/ but it seems I have no access to my Laraval app code so I don’t understand how I’m supposed to run the php artisan schedule:run
command.
On your documentation, you mention a curl http://sample-nodejs:8080
example. Does it mean that the app can only be accessed via a private URL?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi there,
The documentation that you’ve shared gives a Node.js sample app as an example. In order for this to work, you need to get the files from the
docker-cron
repo and use the Dockerfile from the example repo as a blueprint and adjust it for your Laravel project.That way, rather than running the example
curl
command from the demo Node app, the Worker component will clone your Laravel project and will have access to all of the necessary files.Here is an example of an extended Dockerfile which might need some adjustments based on your app:
An alternative option is to use the suggestion here with a standard worker and a while loop:
https://www.digitalocean.com/community/questions/laravel-app-platform-cron-job
Let me know how it goes!
Best,
Bobby