How we moved from Heroku to AWS using Docker
Description and use
Migrated a web app from Heroku to AWS using Docker: containerized with Docker, stored in ECR, deployed on ECS Fargate, database moved to RDS, CI/CD via GitHub Actions, monitoring with CloudWatch. Reduced costs and gained control.
Problem
The team needed to migrate a production web application from Heroku to AWS to gain more control over infrastructure, reduce costs, and improve scalability.
Outcome
The migration completed in under two weeks, reducing monthly hosting costs by ~30% and providing greater control over scaling and networking. The team gained visibility into logs and metrics, and the deployment pipeline became fully automated.
Workflow
- 1. Containerized the existing Heroku app using Dockerfile and docker-compose.
- 2. Pushed the Docker image to Amazon ECR.
- 3. Created an ECS Fargate cluster and task definition pointing to the ECR image.
- 4. Configured an Application Load Balancer to route traffic to the ECS service.
- 5. Migrated the PostgreSQL database from Heroku Postgres to Amazon RDS, updating connection strings.
- 6. Set up CI/CD with GitHub Actions to build and deploy Docker images to ECR and ECS.
- 7. Updated DNS records to point to the new ALB.
- 8. Monitored the new deployment with CloudWatch and performed load testing to validate performance.
Evidence
We containerized the existing Heroku app using Dockerfile and docker-compose.
Pushed the Docker image to Amazon ECR and created an ECS Fargate cluster.
- Record date: 2026-09-21T10:45:36.485Z