A simple java application deployment for a POC.
Automate evrything, because there is no reason to do it twice.
Using this technologies I have created 2 docker images (One based on jetty and the other based on nginx) which in combination with systemd and nfs in the case of the multivm create a simple deployment POC.
For a single vm deployment use:
cd /path/to/this/repo
vagrant up --provision
For a multi vm deployment use:
cd /path/to/this/repo
VAGRANT_VAGRANTFILE=Vagrantfile-multivm vagrant up --provision
After turning on the vms you will be able to see the page at http://192.168.33.10.
TIP: in a multivm deployment you can see the haproxy status page at http://192.168.33.10/haproxy.
cd /path/to/this/repo
vagrant destroy -f
For a multi vm deployment use:
cd /path/to/this/repo
VAGRANT_VAGRANTFILE=Vagrantfile-multivm vagrant destroy -f
Here I'll list some of the improvements that come quickly to my mind right now.
- Replace NFS by a more cloud friendly distributed filesystem like:
- Replace ansible deployment by:
- Replace haproxy with Amazon ELB + Autoscaling Group
- Any CDN for static assests
- Replace static assets hosting in nginx with an Amazon S3 Based alternative for production at least.
- Better versioning for the app. This simplifies rollback in case of needed.
- Make the Docker images configurable by env vars.
- Local docker registry for more speed on deployments.
- SECURITY a lot more security on all the layers ranging from network up to daemons configurations.
- make the app more cloud friendly following the 12factor.net recommendations.
- Use highly scallable persistence layer like any JDBC compatible database or any NoSQL databases like Cassandra, Hazelcast, or even Redis. This is more a dev decision than mine.
- Use Amazon Lambda in combination with the previuos modifications to create a NoServer deployment restful app.
Any suggestion is more than Welcome.