How to give docker app to start command from PHP website?

I have put my python application in a docker container and hosted it on a AWS EC2 instance. I have my webiste in PHP and hosted on a seperate EC2 instance. How can i give the docker run command from my website?

i would make the python app a web api app, then you could call it from your website. no need to know abut docker.