Play 2.5 application with build configuration and instructions for deploying to AWS (Amazon Web Services) Elastic Beanstalk.
- Seed for Play/Scala app
- Usage of SBT Elastic Beanstalk plugin
- Usage of SBT Native Packager Docker plugin
- Usage of sbt-buildinfo plugin
- Configuration for connecting to RDS
- Create an AWS account: https://aws.amazon.com
- Select "Elastic Beanstalk" from services: https://console.aws.amazon.com/elasticbeanstalk/home
- Click "Create New Application"
- Application Info - name/description: Choose whatever you want, i.e. "play-elastic-beanstalk"
- New Environment: Web Server Environment
- Environment Type - Predefined Configuration: Generic -> Docker - Environment type: Single instance
- Application Version: Sample application
- Environment Information - Environment name: Choose a unique name, i.e. "play-eb--env" - Environment URL: Will be auto created
- Additional Resources - Create an RDS DB instance: check
- Configuration Details: Use defaults
- Environment Tags: none
- Permissions: Use defaults
- Review Information: Click "Launch"
sbt elastic-beanstalk:dist
Note output which indicates package location
- Select application/environment from AWS Elastic Beanstalk console
- Click "Upload and Deploy"
- Choose file (see Build distribtion), i.e. /target/elastic-beanstalk/play-elastic-beanstalk-0.2.0.zip
- Version label: Use default or trim to app version number (0.2.0)
- Configure for production
- Select "Configuration" from your environment in the Elastic Beanstalk console
- Select "Software Configuration" and in Environment Properties add this property: - Property Name: JAVA_OPTS - Property Value: -Dconfig.resource=production.conf
View your app with the environment URL provided in the Elastic Beanstalk console. The homepage will show the following:
- Environment (should be production)
- Build info
- If you set up an RDS database, the environment variables for connecting to it
How to set up continuous deployment to Elastic Beanstalk using Github and Jenkins.
NOTE: Coming soon. In the meantime follow this blog post, note that it may be out of date.
https://www.typesafe.com/activator/template/play-elastic-beanstalk