Docker-Compose.yml

I do not see many docker-compose.yml files online. I have a Docker Swarm Setup I run this docker-compose.yml file but for some reason the build is not working. Why is it not working correctly? All containers are running but when i go to the hppts://:8085 it shows nothing. My setup is AWS ec2 instances on docker swarm. The app runs on workers. Behind proxy

version: "3"

services:
  cms-db:
    image: mysql:5.6
    volumes:
     - "./shared/db:/var/lib/mysql"
    environment:
     - MYSQL_DATABASE=cms
     - MYSQL_USER=cms
     - CMS_SERVER_NAME=Xibo_cms-web
    deploy:
     replicas: 2
     resources:
       limits:
         memory: 1G
     restart_policy:
       condition: on-failure
    networks:
     - xibo
  cms-xmr:
    image: xibosignage/xibo-xmr:release-0.7
    ports:
        - "9505:9505"
    deploy:
     replicas: 2
     resources:
       limits:
         memory: 256M
     restart_policy:
       condition: on-failure
    networks:
     - xibo
  cms-web:
   image: xibosignage/xibo-cms:release-1.8.10
   volumes:
     - "./shared/cms/custom:/var/www/cms/custom"
     - "./shared/cms/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/web/userscrits"
   environment:
     - XMR_HOST=Xibo_cms-xmr
     - MYSQL_HOST=Xibo_cms-db
     - MYSQL_PORT=3306
     - MYSQL_DATABASE=cms
     - MYSQL_USER=cms
   ports:
     - "8085:8085"
   deploy:
     replicas: 2
     resources:
       limits:
         memory: 1G
     restart_policy:
       condition: on-failure
   networks:
       - xibo
networks:
   xibo:
       driver: overlay

Firstly, please keep in mind this is a community forum. You’re not entitled to support with a particular SLA, nor support at all.

People here will attempt to help you, but just because your question isn’t answered inside a couple of hours is no reason to leave an unhelpful followup comment. It’s actually much more likely to get your question ignored in my experience.

To your compose file, I don’t have extensive experience with Docker Swarm. What I can tell you is that you can’t just scale XMR and the database to 2 and have that work. MySQL doesn’t cluster in that way, and XMR doesn’t either.

You may be able to do something along those lines with the CMS application container, but you’ll need to give careful thought to how you handle cache locking etc.

Your environment that you’re passing to the containers is missing several parameters. You’ll need to cover off everything in config.env in the files we provide inside your compose file if you can’t or are unable to run with an environment file.

So TL;DR:

  • Set your replicas to 1 of each container - you can’t cluster just by setting 2 there
  • Correctly copy the required configuration environment from the config.env (or template for that) file in to your compose file, or just use the config.env file as we suggest.

You can find the official compose files here:

1 Like

Thank you for your response! I will take a deeper look in how to get the app up and running in a Docker Swarm. Maybe the Xibo R&D team can start looking into this so maybe companies use it in DEV or PROD docker swarm. To be able to put the app on/in docker swarm. I think I have seen something on the internet about docker-compose.yml file. I designed it around the one you produce and one I seen, to try to make it work. Again thank you for your response.

As far as I know you should be able to use our shipped file, change the version at the top to 3, and add in your deploy section to each container, ensuring only 1 replica, and your custom network setup if you require that.

The rest of the syntax is correct already.

We don’t claim to run on Swarm and don’t have plans in the immediate future to start supporting people with that, but the containers themselves should run fine when given the correct parameters from your configuration.

1 Like