Deployed app on aws ec2 goes down every few minutes

Hi
I have deployed a simple app on free aws ec2 the app runs fine
when i give the command:

python -m streamlit run app.py &

But after a few minutes it goes down and i need to login again and run the above command again to have it up and running. Any suggestions please.
Thanks
Sai