This is basic tutorial and showcase for how to take a basic HTTP API written in Java and run it; first locally, then on Heroku by pushing code, then on Heroku using Docker and finally on AWS by leveraging Convox.
The tutorial was written from the persective of being on MacOS and having Homebrew installed.
- Unless you already have git, install it (e.g.
brew install git
) git clone
this repositorycd cloud-starter
- Install Maven and the Heroku CLI (e.g.
brew install maven heroku
) - Compile and package the application by running:
mvn package
Estimated time to complete this section: 30 seconds
- Deploy:
heroku local
- Estimated deployment time: 1 second
- Test: http://127.0.0.1:8090
Estimated time to complete this section: 5 minutes
- Prerequisites: A Heroku.com account
- Setup:
heroku create <appname> --region eu
- Deploy:
git push heroku master
- Estimated deployment time: 15 seconds
- Test:
https://<appname>.herokuapp.com
Estimated time to complete this section: 10 minutes
- Prerequisites: Docker installed & running on your machine
- Setup:
heroku container:login
- Deploy:
heroku container:push web
- Estimated deployment time: 15 seconds
- Test:
https://<appname>.herokuapp.com
Estimated time to complete this section: 25 minutes
- Prerequisites:
- A Convox.com account
- Install Convox in your AWS account
- Make sure you create a Rack as part of the installation
- Install the Convox CLI
convox login
- This connects the CLI to your account
convox switch <account>/<rack>
- This sets the default Rack for your CLI
- Setup:
convox apps create <appname> --wait
- Deploy:
convox deploy --app <appname> --wait
- Estimated deployment time: 3 minutes
- Get a ☕ while the first deploy sets up the app and propagates the DNS records
- Test:
https://<appname>-<processname>-<something>.<awsregion>.elb.amazonaws.com
- The DNS endpoint is displayed by:
convox services --app <appname>
- The DNS endpoint is displayed by: