title: How to achieve a rolling update with docker-compose?
body: <p>I have a following setup in docker compose</p>
  
  <ul>
  <li><code>nginx</code> for proxying to <code>frontend</code>, <code>backend</code> and serving images</li>
  <li><code>backend</code> app on port 8080 (spring boot)</li>
  <li><code>frontend</code> app on port 4000 (node for SSR)</li>
  <li><code>mysql</code> used by <code>backend</code></li>
  </ul>
  
  <p>Frontend can be updated relatively fast using</p>
  
  <pre><code>docker-compose up -d --no-deps frontend
  </code></pre>
  
  <p>Unfortunately <code>backend</code> takes about 1 minute to start.</p>
  
  <p>Is there an easy way to achieve lower downtime without having to change the current setup too much? I like how simple it is right now.</p>
  
  <p>I would imagine something like:</p>
  
  <ol>
  <li>Start a new instance of <code>backend</code></li>
  <li>Wait till it starts (it could be per timer or a healthtest</li>
  <li>Close the perviously running instance</li>
  </ol>