DEV Community

Imed Adel
Imed Adel

Posted on

What is the easiest way to deploy Docker Compose and update it with no downtime?

I usually work on the frontend, but I had to learn Docker and Nginx last week in order to set up my app's backend. So I am a bit confused about how to deploy it now.

I read about AWS ECS, however, it seems that I cannot "just deploy" to it using my docker-compose.yml file. Deploying directly to EC2 can be problematic when I want to update my backend without any downtime.

I also do not want to introduce any other complicated tool to this setup, because I feel like I need to "digest" what I've learned so far.

PS. ECS CLI supports deploying using a Docker Compose file, but it's missing some Docker Compose features that I'm currently using.

Top comments (4)

Collapse
 
steobrien profile image
Stephen O'Brien

Here's a very simple solution we found requiring no dependencies beyond nginx and docker-compose: engineering.tines.com/blog/simple-...

Turns out, a well placed bash script does the trick! Hopefully this can help others.

Collapse
 
bennyychan profile image
Benny Chan

Docker-compose itself doesn't have Zero downtime deployment build-in. It's just a wrapper for docker commands so you can manage a bunch of docker containers easily. But you can use Docker Swarm to do so. Docker Swarm is packaged with docker for you to achieve clustering.

Collapse
 
imed profile image
Imed Adel

I see, thank you :) I'll be using this method

However, what do companies generally use to deal with this (aside from having a load balancer)?

 
imed profile image
Imed Adel

That was very helpful, thank you! :)