Deployed app on aws ec2 goes down every few minutes

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

python -m streamlit run &

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.