I'm new to devops and I'm have a hard time finding resources to help me with this question. My Goal is to have an automated CI/CD pipeline to launch my project.
Basically I have a GitHub repo with a Python Web application. I've also configured a pipeline in CircleCI that runs some tests in the project. That's what I've gotten to work so far.
Now, from what I've understood, this is what I would do next (This is what I'm unsure of so please correct me):
- In circleCI, generate a docker image with instructions on what kind of operating system etc and commands to pull project from GitHub repo and run database migrations etc.
- CircleCI runs terraform to launch this docker file in an EC2 Instance.
So my question is basically this:
- Should the docker image be generated dynamically in CircleCI or static in the repo?
- How does my source code get to the EC2 instance. Configure a
git pull
in dockerfile? - How do I tell CircleCI/Terraform how many instances I want to launch?
I know this is a question that would take too long to explain in full here. So I'm only looking to understand the basic workflow of how GitHub->CircleCI->Terraform->AWS interactive with eachother. Or any resources that explain this well.