Skip to content

Deploying a Dockerized Spring Boot application to AWS Elastic Beanstalk.

Notifications You must be signed in to change notification settings

markhobson/aws-eb-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Elastic Beanstalk Demo

Deploying a Dockerized Spring Boot application to AWS Elastic Beanstalk.

Getting started

  1. Install the AWS Elastic Beanstalk CLI

  2. Configure the AWS Elastic Beanstalk CLI:

     eb init --platform docker-17.09.1-ce --region eu-west-2 aws-eb-demo
    
  3. Create the environment in AWS, selecting the defaults when prompted:

     eb create
    

    WARNING: You will be charged for these resources until they are destroyed.

  4. Visit the outputted environment CNAME, e.g. http://aws-eb-demo-dev.eu-west-2.elasticbeanstalk.com/

Manual deployment

To manually deploy the project to AWS:

mvn clean package
docker build -t markhobson/aws-eb-demo .
docker login
docker push markhobson/aws-eb-demo
eb deploy

Continuous deployment

We'll use CircleCI for continuous deployment.

  1. Add the project

  2. Add environment variables for your Docker Hub credentials:

    • DOCKER_REGISTRY_USERNAME
    • DOCKER_REGISTRY_PASSWORD
  3. Add environment variables for your AWS credentials and region:

    • AWS_ACCESS_KEY_ID
    • AWS_SECRET_ACCESS_KEY
    • AWS_DEFAULT_REGION

The job builds the project within the Docker container .circleci/images/primary/Dockerfile. If you need to rebuild this:

docker build -t markhobson/aws-eb-demo-primary .circleci/images/primary
docker login
docker push markhobson/aws-eb-demo-primary

Destroying

To terminate the environment in AWS:

eb terminate --force aws-eb-demo-dev

You will no longer be charged for these resources.

About

Deploying a Dockerized Spring Boot application to AWS Elastic Beanstalk.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages