title: How to run two images on same machine in docker swarm cluster
body: <p>I use docker swarm with several machines and several images. In particulat, I have database and container, that shedules backups. I need to start them on same machine. How i can setup this with docker-compose?</p>
  
  <pre><code>version: "3"
  services:
      my_mongodb:
          image: mongo
          environment:
            - MONGO_DATA_DIR=${DATA_DIR}
          networks:
           - webnet
      my_backup:
          image: mybackup
          environment:
            - MONGO_DATA_DIR=${DATA_DIR}
     #other images
  </code></pre>