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.
Discussion (5)
The only solution I know of for true "zero downtime" is to use a "load balancer", and then that means you have a minimum of two instances running most of the time so you can therefore take one down temporarily with no service interruption.
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)?
In production systems a load balancer is always the solution.
However, the trick I use for development to make it where I can rebuild my Java class files and restart the container very rapidly is to make the VM point to my local folder where the compiler output goes to (class files) and then I make a docker volume point to that, so that the docker container is always reading my local files (java classes), adn I can simply run a shell script to 'restart' the container and it only takes a second or two.
That was very helpful, thank you! :)
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.