All posts
AWS Architecture

From docker-compose on a VM (or Docker Swarm) to ECS: A Small-Team Migration

By

October 25, 2026

5 min read

Many products still run as a docker-compose file on one server, or a small Swarm cluster. It works until the server needs patching, the disk fills or traffic doubles. How the pieces of a compose file map to ECS, where state should go, and how ECS Express Mode and ECS Gateway make the move small.

Docker Compose
Docker Swarm
Amazon ECS
Fargate
Migration

How a compose file maps to AWS

In docker-compose

On AWS

A service with an image

An ECS service on Fargate (or ECS Managed Instances)

ports and a reverse proxy container

An ALB, or ECS Gateway / Express Mode for managed HTTPS

A postgres or mysql container with a volume

RDS or Aurora, never a container with an EBS volume

A redis container

ElastiCache for Valkey

Named volumes for uploads

S3, or EFS if the application needs a file system

environment and .env files

Secrets Manager and SSM Parameter Store referenced in the task definition

depends_on and links

Service discovery with ECS Service Connect

A cron container

EventBridge Scheduler running an ECS task

Want a second opinion on this for your system?

Book a free 30-minute call. You'll leave knowing what we'd do first and roughly what it costs, whether or not you hire us.

Order of work

  1. Move state first: database to RDS, files to S3, cache to ElastiCache, with the old server pointing at the new ones.

  2. Push images to ECR from CI instead of building on the server.

  3. Create the ECS services and run them alongside the old server behind a weighted DNS record or load balancer.

  4. Shift traffic, watch, and switch the old server off.

hoolco Monthly Review

Once a month: what changed in tech that month and what it means for you, from cloud and AI to security and the tools you build with. Every item links to its source. No sales pitch, unsubscribe in one click.

As of October 25, 2026. Provided as is, for general information, and accurate to the best of our knowledge on the date shown. Not legal, compliance, tax, financial or other professional advice. Prices, limits and vendor services change; check current vendor documentation before relying on anything here. Terms of use.