This isn't generic at all but you can see how to do this for the following types of projects:
- Gradle project running on Apache
- Angular2 project
- ScalaJs SBT project
This is using a plain vanilla Ubuntu AMI so the main issue is getting the prerequites installed on the server.
- aws_boot2.sh is cleaned-up version that removes Ruby on Rails and Amazon AMI support (rails is a pain to setup)