{"id":13942710,"url":"https://github.com/devteds/e7-cloudformation-docker","last_synced_at":"2026-03-12T11:03:39.807Z","repository":{"id":132073100,"uuid":"89182808","full_name":"devteds/e7-cloudformation-docker","owner":"devteds","description":"Create AWS CloudFormation Stack and deploy Dockerized application. Devteds episode #7 https://devteds.com/episodes/7-create-aws-cloudformation-stack-for-ec2-rds-and-deploy-docker-app","archived":false,"fork":false,"pushed_at":"2022-08-09T21:57:49.000Z","size":6,"stargazers_count":30,"open_issues_count":0,"forks_count":60,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-10T05:10:49.686Z","etag":null,"topics":["aws","aws-cloudformation","aws-ec2","aws-rds","aws-rds-mysql","cloudformation","docker","docker-compose","docker-on-aws","ec2"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devteds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-04-24T00:48:31.000Z","updated_at":"2023-11-23T02:35:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"63a58e11-ef49-4edc-acdf-d87b500552d6","html_url":"https://github.com/devteds/e7-cloudformation-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe7-cloudformation-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe7-cloudformation-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe7-cloudformation-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devteds%2Fe7-cloudformation-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devteds","download_url":"https://codeload.github.com/devteds/e7-cloudformation-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248161274,"owners_count":21057555,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","aws-cloudformation","aws-ec2","aws-rds","aws-rds-mysql","cloudformation","docker","docker-compose","docker-on-aws","ec2"],"created_at":"2024-08-08T02:01:59.902Z","updated_at":"2026-03-12T11:03:39.746Z","avatar_url":"https://github.com/devteds.png","language":null,"funding_links":[],"categories":["Others"],"sub_categories":[],"readme":"# AWS CloudFormation + EC2 + RDS and Docker App\n\nDevteds [Episode #7](https://devteds.com/episodes/7-create-aws-cloudformation-stack-for-ec2-rds-and-deploy-docker-app)\n\nCreate an application stack that consist of an EC2 instance and RDS Instance for MySQL, using AWS CloudFormation. And then deploy an dockerized / containerized API application to run on EC2 instance.\n\n[Episode video link](https://youtu.be/8J0g_xWUzV0)\n\n[![Episode Video Link](https://i.ytimg.com/vi/8J0g_xWUzV0/hqdefault.jpg)](https://youtu.be/8J0g_xWUzV0)\n\nVisit https://devteds.com to watch all the episodes. If you're looking to learn [Docker with ECS](https://github.com/devteds/e9-cloudformation-docker-ecs) checkout [episode #9](https://devteds.com/episodes/9-docker-on-amazon-ecs-using-cloudformation)\n\n\u003e ## Announcement: Course on Kubernetes\n\u003e If you're want to start deploying your containers to Kubernetes, especially on AWS EKS, [check this course on Kubernetes](https://courses.devteds.com/kubernetes-get-started) that walkthrough creating Kubernetes cluster on AWS EKS using Terraform and deploying multiple related containers applications to Kubernetes and more. https://courses.devteds.com/kubernetes-get-started\n\n## Setup AWS \u0026 CLI\n\n- Login to AWS Management Console and Generate a new KeyPair. Save the downloaded key\n- Configure AWS Command Line Interface (AWS CLI) with a new AWS Access Key and a secret generated on AWS\n- Update the stack.yml if you're using this template for your application\n- Use AWS CLI to run create-stack command that'll create all the resources defined in the stack.yml\n- Update the docker-compose app.yml if you're using this for your application\n- Using docker compose run database migration command, run service in background and run db-seed to populate test data\n\n## Commands\n\n```\nmkdir ~/projs\ngit clone https://github.com/devteds/e7-cloudformation-docker.git deploy-aws\ncd deploy-aws\n\n# Create new KeyPair on AWS CLI and name it aws-key1 and,\ncp ~/Downloads/aws-key1.pem ./\nchmod 400 aws-key1.pem\n\n# On AWS CLI, Create a new user with programatic access which will generate a new Access Key \u0026 Secret. With that,\naws configure --profile demo\n# Make sure to use the region name (us-west-2 or another) as the default for this profile 'demo'\n\naws cloudformation create-stack --profile demo --stack-name blog-stage --template-body file://$PWD/stack.yml\n\n# After the stack creation is successful, Get the IP address or DNS of the AppNode EC2 instance\nssh -i aws-key1.pem ubuntu@\u003cIP ADDRESS OR DNS OF THE EC2 INSTANCE\u003e\n\n# Point your local to EC2 instance,\nexport DOCKER_HOST=tcp://35.160.122.95:2375\ndocker ps -a\n\ndocker-compose -f app.yml run --rm app rails db:migrate\ndocker-compose -f app.yml up -d\ndocker-compose -f app.yml ps\ndocker-compose -f app.yml run --rm app rails db:seed\n\n# Make sure to delete the stack and all resources when you're done\naws cloudformation delete-stack --stack-name blog-stage --profile demo\n```\n\n## More useful commands\n\n```\naws cloudformation describe-stack-resources --stack-name blog-stage --profile demo\naws cloudformation describe-stack-events --stack-name blog-stage --profile demo\n\n# For more help\naws cloudformation help\naws cloudformation create-stack help\naws cloudformation delete-stack help\naws cloudformation delete-stack help\naws cloudformation describe-stack-resources help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevteds%2Fe7-cloudformation-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevteds%2Fe7-cloudformation-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevteds%2Fe7-cloudformation-docker/lists"}