Skip to content

What is the best practice for zero downtime deployment of a Docker service? #492

Closed Answered by Siumauricio
callmewhy asked this question in Q&A
Discussion options

You must be logged in to vote

I leave you with this simple to understand example,

we will use a basic express app, which does 2 things

https://github.com/Dokploy/swarm-test

  1. it has 1 endpoint called /health Endpoint which is the one that will tell us if our application is healthy.
  2. for testing purposes I added a delay at the start of the application to simulate when our application is restarting or deploying a new version Delay

We are going to use Nixpacks as builder and your config should similar to this

If you want to test that there is no zero downtime yet, you can simply deploy the application and then create another deployment and while doing the deployment reload the page in the path /health and you will see th…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@johngrimsey
Comment options

Comment options

You must be logged in to vote
1 reply
@johngrimsey
Comment options

Answer selected by callmewhy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants