I have a docker-compose.yml configuration docker-compose.yml that currently runs all applications on one server:

 version: '2' services: nginx: image: nginx:latest ports: - "80:80" volumes: - ./dockerfiles/nginx:/etc/nginx/conf.d - ../static:/static - ../media:/media depends_on: - web web: build: ./dockerfiles/web/ command: bash -c 'uwsgi --ini ./settings/uwsgi_conf.ini' depends_on: - db - solr-docker - redis-docker - celery volumes: - ./web:/web - ../static:/static - ../media:/media solr-docker: image: solr:latest volumes: - ./dockerfiles/solr/default:/opt/solr/server/solr/mycores/default db: image: postgres:latest 

I want to bring Solr to 2nd server. After reading the articles on this issue, where it is proposed to use the Docker Machine + Swarm + Compose bundle, porridge formed in my head. Is it possible to make everything easier? On SO found an offer to use extra_hosts :

 solr-docker: image: solr:latest volumes: - ./dockerfiles/solr/default:/opt/solr/server/solr/mycores/default extra_hosts: - "solrhost:111.222.333.44" 

But this option does not work. Maybe I'm not cooking it that way. Maybe something needs to be done on the 2nd server (on which I want to run Solr )?

Compose attractive because everything is configured in one file. If you can not implement a project on multiple servers through Compose , how to do it as simply as possible?

  • One Compose you will not get along, you need Swarm. Seriously think, is it worth it :) - D-side
  • one
    You can split into two docker-compose, but the easiest way is to take a more powerful server. It’s really logical to split them into hosts, just at this stage you will find a large amount of hell adapting to any orchestrator. - etki
  • @etki, is it possible to learn more about 2 Compose? Everyone runs on their server, as I understand it. And how at the same time Solr on the 2nd server to add to the environment of the first? - TitanFighter
  • Indicating aypishnik second server - etki
  • one
    @TitanFighter docker-machine allows you to install docker on the specified machine. if you already have a docker there, then you don't need it. - Mikhail Vaysman

0