GithubHelp home page GithubHelp logo

csgear / aws-ecs-springboot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from s-polimetla/aws-ecs-springboot

0.0 0.0 0.0 11 KB

Springboot CRUD Application deployed on AWS ECS Fargate in a CI/CD way

Home Page: https://medium.com/@polimetla/ci-cd-pipeline-for-aws-ecs-fargate-958d5c29205d

License: MIT License

Dockerfile 3.19% Java 96.81%

aws-ecs-springboot's Introduction

aws-ecs-springboot

Springboot Application packed into a docker container to be deployed on AWS ECS

The deployment is done using build-pipeline-docker-ecs.yaml

This step creates a CodePipeline which is triggered upon a commit to the master branch

For local testing

Clone the repository. Make sure you have Java11 and Docker installed. If you do not want to install Java11, you may chose to mount the project onto a docker container based on openjdk:11 and docker installed.

Run the following commands

mvn clean install
docker build -t <Your-Image-Name>:<Your-Tag> .
docker run -p 80:8080 <Your-Image-Name>:<Your-Tag>

Once the docker container starts running, you can test it on localhost/employees. At start you would not have any data. Create data using POST requests.

AWS Deployment

Upload build-pipeline-docker-ecs.yaml to CloudFormation console or using AWS CLI. This is the only manual step to be done using AWS Console. It has all the configuration to automate the creation and deployment of the service on ECS.

Note

  1. The value for DockerImageRepository given after uploading the pipeline file should match DockerImageRepository in config.json
  2. Here the database is embedded within a running instance. So each running task (in this case 2) has its own database and consequent GET requests may look different because of the usage of LoadBalancer although the endpoint is the same.
  3. The file build-pipeline-docker-ecs.yaml is generic and not directly related to this project. It is only packed into this repository to have all components at a single place.
  4. Upon each commit to the master, a new TaskDefinition is created and the ECS service is updated.
  5. This project is not production ready since it does not have a real persistent component.
  6. Lifecycle policy is configured to have only 5 image versions in ECR. You may not want to do it in production.

After a successful deployment you now should have another CloudFormation stack created by the Deploy stage of the pipeline. Among Outputs of this stack you will find the endpoint for your API

aws-ecs-springboot's People

Contributors

s-polimetla avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.