Chapter 9. Configuration, build, and deployment
This chapter covers
- Application configuration and environments
- sbt builds and working with plugins
- Deploying as a web archive
- Deploying as a standalone distribution
- Running a Scalatra application as a Docker container
This chapter discusses topics related to configuring, building, and running an application. In section 9.1 you’ll learn how to provide configuration to an application and how to work with application environments. Section 9.2 covers defining the sbt build and employing sbt plugins.
Once you’ve built your application, you’ll need to know how to deploy it and make it available to the public. The next two sections provide a gentle introduction to the mysteries of JVM deployments, suitable for people coming from other backgrounds. Section 9.3 discusses the web archive (WAR) file, which is a typical deployment method for servlet-based web applications. Section 9.4 builds a standalone application, which embeds a servlet container. Section 9.5 then shows how to use Scalatra with Docker. We’ll start with configuration.
An application’s configuration is how you tell the application about the environment it runs in. It’s the context that allows an application to adapt itself to different environments. For example, one setting might hold the directory on the filesystem that’s used to store file uploads.