How we moved from Heroku to AWS using Docker
Описание и применение
Перенос веб‑приложения с Heroku на AWS с использованием Docker: контейнеризация, ECR, ECS Fargate, RDS, GitHub Actions, CloudWatch. Сокращение расходов и улучшение контроля.
Задача
The team needed to migrate a production web application from Heroku to AWS to gain more control over infrastructure, reduce costs, and improve scalability.
Результат
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.
Рабочий процесс
- 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.
Доказательства
We containerized the existing Heroku app using Dockerfile and docker-compose.
Pushed the Docker image to Amazon ECR and created an ECS Fargate cluster.
- Дата записи: 2026-09-21T10:45:36.485Z