Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How we moved from Heroku to AWS using Docker

说明与用途

使用 Docker 将 Web 应用从 Heroku 迁移到 AWS:使用 Dockerfile 容器化,推送至 ECR,部署在 ECS Fargate,数据库迁移至 RDS,使用 GitHub Actions 自动化 CI/CD,使用 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