Skip to content

Running Boot on Heroku

Juho Teperi edited this page Mar 8, 2016 · 2 revisions

Boot buildpack: https://github.com/upworthy/heroku-buildpack-boot.git

If you have existing Heroku project, you can change the buildpack with following command:

heroku buildpacks:set https://github.com/upworthy/heroku-buildpack-boot.git

Your Boot project should define build task which makes the project ready to run, e.g. creates uberjar.

Procfile

web: java $JAVA_OPTS -jar target/app.jar

Instead of creating uberjar, you could also call boot in your Procfile. This will result in smaller slug at cost of startup time.

Challenges

  • All files from both the repository and from build will be included in Heroku slug
    • Maximum size is 300MB
    • When using uberjar clear target directory of any unnecessary files to reduce slug size
    • (comp ... (jar :file "app.jar") (sift :include #{#"app.jar"}) (target :dir #{"target"}))
Clone this wiki locally