This project creates a containerized web service project. The project uses Terraform to define and deploy a containerized Node.js web service on Amazon Elastic Container Service (Amazon ECS). The project deploys a containerized app to an Amazon ECS cluster on AWS Fargate serverless compute. After your workflow runs successfully, the sample web service is publicly available through the Application Load Balancer.
The deployed application can be accessed at https://dev.quest.nbekenov.com/
/iac contains the infrastructure as code (IaC) terraform files.
/src contains the application source code
/test contains dummy unit tests for application.
/bin contains the frontend source code.
/.codecatalyst conatins CodeCatalyst workflows definition
/scripts helper scrips used in the workflow
- NPM
- Docker
- Terraform
To get started with the project, follow the steps below:
- Clone this repository to your local machine
- Navigate to the project directory
- Run
npm installto install the dependencies - Run
npm startto start the application - Open your web browser and go to http://localhost:3000 to view the app
docker build -t quest:latest .
docker run -p 3000:3000 quest:latest
npm run build
npm test
This project uses CodeCatalyst for continuous integration and continuous deployment (CI/CD). The ./codecatalyst/workflows/main_branch.yml file defines the CI/CD pipeline, which includes building the application, running tests, and deploying the application to AWS.
The Amazon CodeCatalyst workflow contains the following actions:
- Software Composition Analysis (SCA) - SCA uses Trivy to review the dependencies in the application and to identify known security vulnerabilities.
- Build - Build uses ESLint and Jest to compile source code, run unit tests and static analysis on code quality, coding standards.
- Bootstrap - Bootstrap create resource for Terraform remote backend. More details readme.md
- Package - Package uses Docker to build the image and Trivy to scan for vulnerabilities in the operating system and in libraries used by the image.
- Deploy - Deploy performs a Terraform deployment of the application to the dev environment.
The IaC code for this project is written in Terraform, and it defines the necessary infrastructure components such as the ECS, ALB, VPC and more README.md
To contribute to this project, follow the steps below:
- Fork this repository
- Create a new branch (
git checkout -b feature/branch-name) - Make your changes
- Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin feature/branch-name) - Create a new Pull Request
This project is licensed under the MIT License. See the LICENSE file for more information.
