Messing around with Docker some more.
This project works with docker to test, build and start an unnecessarily complex app to work with multiple containers and integrating them.
Based on the Udemy course: Docker and Kubernetes: The Complete Guide by Stephen Grider starting at Section 8: "Building a Multi-Container Application"
Note: The terraform
configs are specific to my environment. You'll have to change the "hard-coded" values (that's right - I didn't parameterize! :-p)
- clone the repo
- run
terraform init
&terraform apply
interraform
directory - run
eb init
&eb deploy
infibo-web
directory
Note: These steps are not exact. Derived from a previous app (React App) from the same Udemy course.
- brew install node
- mkdir fibo-web fibo-web/{client,server,worker,nginx}
- extract files Section: 9 Lecture: 116
- create {client,server,worker,nginx}/Dockerfil.dev files
- create nginx/default.conf file
- create docker-compose.yml file
- docker-compose up [--build]
- AWS credentials in ~/.aws/config
- Docker Hub credentials as Jenkins environment vars in global config
- Create/Modify Jenkinsfile
- Jenkins
- multibranch project
- specify the correct Jenkinsfile
- set up the GitHub creds (username/password) standard or Pers Access Token
- Change working directory to
terraform
cd terraform
- Apply the
terraform
configurations (may need to runterraform init
first)
terraform apply
- AWS Elastic Beanstalk (Application and Environment)
- Create the app and env (web server / multi-container docker)
- Set up environment variables (Dockerrun.aws.json with resources below)
- Amazon RDS (PostgreSQL)
- Create an RDS DB (Dev/Test) (credentials/db name to match Dockerrun.aws.json)
- small burstable instance, minimal memory and disk space
- no extra anything, automatic backups, multi-az, enhanced monitoring
- Create a AWS SG for PostgreSQL
- Amazon ElastiCache (Redis)
- Create a Redis Cluster
- zero replicas, no automatic backups
- Create a AWS SG for Redis
- install AWS ElasticBeanstalk CLI (eb)
- initialize the EB environment:
eb init [--profile PROFILE]
- deploy to EB:
eb deploy [--staged]
(in the Jenkinsfile)