Play Framework

Deploy to Heroku

Java Version

Create a system.properties file and specify Java version.

java.runtime.version=1.8

Note Heroku supports 1.8 by default.

Config

Application Secret

  • Run sbt playGenerateSecret to generate a key and add in application.conf

# application.conf
play.http.secret.key=${?APPLICATION_SECRET}

Hosts

  • Add allowed hosts in application.conf

# Hosts
play.filters.hosts {
  # Allow requests to example.com, its subdomains, and localhost:9000.
  allowed = ["abc.herokuapp.com/", "localhost:9000"]
}

Deployment

Deploying to a remote Git repository

Deploying with the sbt-heroku plugin

1. Add plugin in project/plugins.sbt

2. In build.sbt

3. Deploy

Ref: https://github.com/heroku/sbt-herokuarrow-up-right

Troubleshooting

CSS not showing on Heroku

References

Last updated