I want to run a python script 'indefinitely' on an EB instance, automatically once deployed (I don't want to SSH in). To do that, I think I should run
source /opt/python/run/venv/bin/activate && nohup python myscriptname.py &
after the Elastic Beanstalk instance is deployed. But where do I put the above command to automatically run this post deployment?
I have looked at How do I install a Python script on Amazon's Elastic Beanstalk? but I don't think a cron job is suitable for me.
I have used container_commands
before but they seem to run pre-deployment.
Container commands run after the application and web server have been set up and the application version archive has been extracted, but before the application version is deployed.
How do I run a post-deploy script?