What is the best way to run cronjob in AWS ECS?
I'm not familiar with Laravel or Artisan but essentially you'll need to:
- create a container image with your job (artisan)
- create a task definition that runs the artisan container when invoked
- create the cron-scheduler to invoke the above task definition
Regarding "The scheduled task seems to be running forever" - ECS Tasks do their job and exit and are not restarted (e.g. cron jobs). ECS Services are restarted when they exit (e.g. web servers). Make sure you're creating a Task and not a Service. Then it should be running forever.
Hope that helps :)