title: docker-compose per microservice in local and production enironments?
body: <p>I want to be able to develop microservices locally, but also to 'push' them into production with minimal configurational changes. I used to put all microservices into one <code>docker-compose</code> locally; but I start to see this might no be the practical.</p>
  
  <p>The new idea is to have single docker-compose <em>per service</em>. This does not means it will run with only one container; it might have more inside (like some datastore behind etc).</p>
  
  <p>From that new point of view, let's take a look at the well-known <a href="https://github.com/docker/example-voting-app" rel="nofollow">docker voting app example</a>, that consist of 5 components:</p>
  
  <ul>
  <li>(<strong>P</strong>) Python webapp which lets you vote between two options</li>
  <li>(<strong>R</strong>) Redis queue which collects new votes</li>
  <li>(<strong>J</strong>) Java worker which consumes votes and stores them in…</li>
  <li>(<strong>S</strong>) Postgres database backed by a Docker volume</li>
  <li>(<strong>N</strong>) Node.js webapp which shows the results of the voting in real time</li>
  </ul>
  
  <p>Let's say you want to push this example into production (so having just one <code>docker-compose</code> is not an option:). Not forget that more infrastructure-related components may be added on top of it (like kibana, prometheus...). And we want to be able to scale what we need; and we use e.g. swarm.</p>
  
  <p>The question is:</p>
  
  <ul>
  <li>How to organize this example: in single <code>docker-composes</code> or many?</li>
  <li>What microservices do we have here? In other words, which components would you combine into single <code>docker-compose</code>? Example: <strong>J</strong> and <strong>S</strong>?</li>
  <li>If services are not in single docker-compose, do we add them to same overlay network to use swarm dns feature?</li>
  <li>and so on...</li>
  </ul>
  
  <p>(I don't need details on how to install stuff, this question is about top-level organization)</p>