Multiple Xibo on Single Server

HI All,

I am trying to set up multiple Xibo on a single ubuntu server.
I’m new to docker and have been learning as I go. I have manged to get a single instance of Xibo running perfectly on its own.
However I need to have 2-3 Instances of Xibo on a single server. I setup Nginx first then set up an instance of xibo.
I have never used Nginx so I am going of things I found on google…

I changed the ports in Xibo to 127.0.0.1:9506:9505 & 127.0.0.1:81:80

Then ran the cmd (i tried several this is the only one that would run)
sudo docker run -d --name xibo --expose 80 --net nginx-proxy -e VIRTUAL_HOST=signage.mysite.com xibosignage/xibo-cms:release_1.8.0

if i go tot he website signage.mysite.com it loads up and says
Fatal Error - sorry this shouldn't happen. SQLSTATE[HY000] [2005] Unknown MySQL server host 'mysql' (0)

I’m assuming I’m doing this wrong, can you let me know the right way to do this?

e4377b95053 xibosignage/xibo-cms:release_1.8.0 "/entrypoint.sh" About an hour ago Up About an hour 127.0.0.1:81->80/tcp xibo_cms-web_1 c153d6106cd3 xibosignage/xibo-xmr:release_1.8.0 "/entrypoint.sh" About an hour ago Up About an hour 50001/tcp, 127.0.0.1:9506->9505/tcp xibo_cms-xmr_1 2bc27364a7d4 xibosignage/xibo-cms:release_1.8.0 "/entrypoint.sh" About an hour ago Up About an hour 80/tcp signage2 b78c99e90e01 mysql:5.6 "docker-entrypoint.sh" About an hour ago Up About an hour 3306/tcp xibo_cms-db_1 6d22b9df7bb8 jwilder/nginx-proxy "/app/docker-entrypoi" About an hour ago Up About an hour 0.0.0.0:80->80/tcp nginx-proxy

You can’t really run the CMS container alone, it needs the supporting containers too.

You need to use the docker-compose files we ship, and modify those to suit your proxy.

So for example, in your command above, you’d make a directory for the first instance, and extract the docker-compose files in to it. You’d then setup config.env per the instructions in the manual.

You’d then copy the cms_custom-ports.yml.template file to cms_custom-ports.yml, and customise it for your needs. Something like this perhaps:

version: "2.1"

services:
    cms-db:
        image: mysql:5.6
        volumes:
            - "./shared/db:/var/lib/mysql"
        restart: always
        environment:
            - MYSQL_DATABASE=cms
            - MYSQL_USER=cms
            - MYSQL_RANDOM_ROOT_PASSWORD=yes
        mem_limit: 1g
        env_file: config.env
    cms-xmr:
        image: xibosignage/xibo-xmr:release_1.8.2
        ports:
            - "9506:9505"
        restart: always
        mem_limit: 256m
        env_file: config.env
    cms-web:
        image: xibosignage/xibo-cms:release_1.8.2
        networks:
            - nginx-proxy
            - default
        volumes:
            - "./shared/cms/custom:/var/www/cms/custom"
            - "./shared/backup:/var/www/backup"
            - "./shared/cms/web/theme/custom:/var/www/cms/web/theme/custom"
            - "./shared/cms/library:/var/www/cms/library"
            - "./shared/cms/web/userscripts:/var/www/cms/web/userscripts"
        restart: always
        links:
            - cms-db:mysql
            - cms-xmr:50001
        environment:
            - XMR_HOST=cms-xmr
            - VIRTUAL_HOST=signage.mysite.com
        env_file: config.env
        mem_limit: 1g
networks:
  nginx-proxy:
    external:
      name: nginx-proxy

Finally you’d run docker-compose -f cms_custom-ports.yml up -d to bring the CMS up.