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

How we moved from Heroku to AWS using Docker

说明与用途

使用 Docker 将 Ruby on Rails 应用从 Heroku 迁移到 AWS,降低了约 30% 的月度成本,并提供了完整的基础设施控制。

问题

The team needed to migrate a Ruby on Rails application from Heroku to AWS to gain more control over infrastructure, reduce costs, and improve scalability.

结果

The migration reduced monthly hosting costs by ~30%, improved deployment speed, and provided full control over the runtime environment.

工作流

  • 1. Containerized the Rails app using Docker, creating a Dockerfile and docker-compose.yml.
  • 2. Set up a local Docker environment to test the container.
  • 3. Created an AWS account and configured IAM roles for deployment.
  • 4. Migrated the PostgreSQL database to Amazon RDS and the Redis cache to ElastiCache.
  • 5. Configured environment variables and secrets in AWS Parameter Store.
  • 6. Deployed the Docker image to AWS Elastic Beanstalk using the Docker platform.
  • 7. Set up load balancing and auto‑scaling groups.
  • 8. Tested the application in staging, then switched traffic to production.
  • 9. Decommissioned Heroku resources and monitored performance and cost on AWS.

证据

We started by containerizing our Rails app with Docker, creating a Dockerfile and docker-compose.yml to replicate the Heroku environment locally.

来源

After setting up the Docker image, we deployed it to AWS Elastic Beanstalk using the Docker platform, which handled load balancing and auto‑scaling for us.

来源

  • 记录日期: 2026-09-15T11:31:09.866Z