title: How to run multiple MongoDBs with different ports within docker-compose?
body: <p>I am trying to run two MongoDBs within one docker-compose. As I want to store different data in each of the databases, I need to distinguish them by different ports. If I run the following docker-compose, everything works fine for port 27017, but I cannot access port 27018. In the console everything looks the same for both services, only the following log is missing for the service on port 27018:</p>
  
  <p>NETWORK  [initandlisten] waiting for connections on port 27017
  (shows up for port 27017)</p>
  
  <p>When I try to access both services in the browser, the one on port 27017 works and the one on 27018 doesn't. </p>
  
  <p>I'm a very glad if anybody can help me out with that issue. Working on it since pretty long. Thanks!</p>
  
  <p>Here's my code: </p>
  
  <pre><code>version: "3"
  
  services:
    mongo:
      image: mvertes/alpine-mongo:4.0.1-0
      volumes:
      - mongoDBvolume:/data/db
      ports:
      - "27017:27017"
  
     testmongo:
      image: mvertes/alpine-mongo:4.0.1-0
      command: mongod --port 27018
      volumes:
      - mongoDBvolume:/data/testdb
      ports:
      - "27018:27017"
  
  volumes:
    mongoDBvolume:
      driver: local
  </code></pre>