- About The Project
- Documents Index
- Getting Started
- Usage
- How To's
- Roadmap
- Contributing
- License
- Contact
This project aims to move a web application from on-premise to a cloud-hosted solution.
Currently, the WordPress-based application uses LAMP stack (Linux, Apache, MySQL, and PHP) and the solution is hosted in a single server (application and database) where the deployments are made through FTP transfers to the server.
This cloud migration is designed to comply with the following requirements:
- The application must be containerized;
- The application must to be secure (all data encrypted at rest and in transit)
- The application must to be highly available.
- The application must to support peaks of up to 10 times the average load (scalability).
- The infrastructure must to be reproducible and version-controlled in case the CEO decides to expand the business to other parts of the world (consider infra as code).
- There must be an easy and secure way of developing, with fast feedback (consider CI/CD practices or at least automation scripts)
- Github - version control
- Terraform - infra as code
- Github actions CICD pipeline
- Docker - containerisation
- Docker-compose - containerisation
- Amazon Aurora - database
- Amazon Elastic Container Service - container orchestrator
- Amazon EFS - file storage
- Make - automation
- Docker Wordpress - How to use
- Scripts Usage
- GitHub Actions/Workflows
- Terraform Modules
-
Create a Github account: https://github.com/join
-
Create your AWS account: https://aws.amazon.com/free/start-your-free-trial/
-
Install AWS cli: https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
-
Install Terraform cli: https://learn.hashicorp.com/terraform/getting-started/install.html
-
Install Docker cli: https://docs.docker.com/install/
-
Install Make: https://www.gnu.org/software/make/manual/html_node/index.html#toc-Overview-of-make
π₯π₯π₯ TL;DR; π₯π₯π₯
GRAB THE POPCORN πΏ
RUNmake kick-n-run
(docker daemon must be running)
ENJOY THE SHOW π π¦
Clone or download the repository to your machine:
git clone https://github.com/devopsacademyau/2020-jun-project1-group1.git
Set up your AWS credentials:
aws configure
Decide on where you want the terraform state files to be stored. local is fine, but s3 is recommened (https://www.terraform.io/docs/backends/types/s3.html)
vim ./terraform/_backend.tf
-
Template file:
.github/terraform/_backend.tf.template
-
Create S3 and dynamodb: run
make tf-backend-storage
Review and update the main.tfvars file with your variables
vim ./terraform/main.tfvars
(Optional) plan the terraform build
make tf-ci-plan
Run below from your root directory
make kick-n-run
Destroy the infrastructure
make tf-ci-remove
- Run
make tf-all
it will create the infrastructure commands only, it will not push the wordpress docker image.
Quickest way:
- Run
make kick-n-run
- Run
make update-wp
- Run
make deploy-wp
- Edit main.tfvars file and change the variable
project
. - Edit
.env
file in the root directory (create if doens't exists) and change the variablePROJECT_NAME
- Edit main.tfvars and change the variable
repository_name
. - Edit
.env
file in the root directory (create if doens't exists) and change the variableDOCKER_REPOSITORY
- Edit
.env
file in the root directory (create if doens't exists) and change the variableDOCKER_REGISTRY_URL
-
Use template file
.github/terraform/_backend.tf.template
to create the_backend.tf
file into terraform folder. -
Create S3 and dynamodb: run
make tf-backend-storage
See the open issues for a list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b <branch-name>
) - Commit your Changes (
git commit -m 'Add a new contribution'
) - Push to the Branch (
git push origin <branch-name>
) - Open a Pull Request
Distributed under the Creative Commons Public Licenses. See LICENSE
for more information.
TBC