Xibo Docker with an external database

This guide covers bootstrapping/starting and upgrading Xibo Docker with an external database. In this configuration Xibo Docker only provides the web server and XMR.

If you want to use Xibo Docker as provided (internal database) then please refer to the CMS Docker installation guide.

Bootstrapping

The Xibo containers will need to be configured and started manually - or launcher will need to be modified to remove references to the local mysql container that is created.

To manually run the containers the following 2 statements much be executed in order. Each statement contains $variable's which should be substituted for real values before the statement is run.

docker run --name $INSTANCE_NAME-cms-xmr -p $XMR_PLAYER_PORT:9505 -d xibosignage/xibo-xmr:$XMR_VERSION
docker run --name $INSTANCE_NAME-cms-web -p $WEBSERVER_PORT:80 -e XMR_HOST=$INSTANCE_NAME-cms-xmr -e CMS_SMTP_SERVER=$CMS_SMTP_SERVER -e CMS_SMTP_USERNAME=$CMS_SMTP_USERNAME \
             -e CMS_SMTP_PASSWORD=$CMS_SMTP_PASSWORD -e CMS_SMTP_USE_TLS=$CMS_SMTP_USE_TLS -e CMS_SMTP_USE_STARTTLS=$CMS_SMTP_USE_STARTTLS \
             -e CMS_SMTP_REWRITE_DOMAIN=$CMS_SMTP_REWRITE_DOMAIN -e CMS_SMTP_HOSTNAME=$CMS_SMTP_HOSTNAME -e CMS_SMTP_FROM_LINE_OVERRIDE=$CMS_SMTP_FROM_LINE_OVERRIDE \
             -e CMS_DATABASE_PASSWORD=$CMS_DATABASE_PASSWORD \
             -e CMS_DATABASE_HOST=$CMS_DATABASE_HOST \
             -e CMS_DATABASE_PORT=$CMS_DATABASE_PORT \
             -e CMS_DATABASE_USERNAME=$CMS_DATABASE_USERNAME \
             -e CMS_DATABASE_NAME=$CMS_DATABASE_NAME \
             -d -v $DATA_DIR/shared/cms/custom:/var/www/cms/custom -v $DATA_DIR/shared/backup:/var/www/backup -v $DATA_DIR/shared/cms/web/theme/custom:/var/www/cms/web/theme/custom \
             -v $DATA_DIR/shared/cms/library:/var/www/cms/library -v $DATA_DIR/shared/cms/web/userscripts:/var/www/cms/web/userscripts \
             --link $INSTANCE_NAME-cms-xmr:50001 xibosignage/xibo-cms:$CMS_VERSION

The variable substitutions in the above statements should be set according to the following template (default values are provided).

# The version to install
CMS_VERSION=release_1.8.0-rc1
XMR_VERSION=release_1.8.0-rc1
# Name prefix for the containers used in this
# application
INSTANCE_NAME="xibo"
## Where should we store your user data
DATA_DIR=$(pwd)
## SMTP Server Configuration
## The CMS needs to be able to send email to you
## Please enter credentials for a suitable SMTP server
## Defaults will work for GMail - replacing your GMail username
## and password as appropriate. You will also need to enable access
## for less secure applications on your GMail account for this to
## work. See https://support.google.com/accounts/answer/6010255
## SMTP Server Hostname
CMS_SMTP_SERVER=smtp.gmail.com:587
## SMTP Username
CMS_SMTP_USERNAME=youraccount@gmail.com
## SMTP Password
CMS_SMTP_PASSWORD=yourpassword
## Use a TLS Connection YES/NO
CMS_SMTP_USE_TLS=YES
## Use a STARTTLS Connection YES/NO
CMS_SMTP_USE_STARTTLS=YES
## Rewrite domain (the domain your email will appear to come from)
CMS_SMTP_REWRITE_DOMAIN=gmail.com
## Hostname that we should identify ourself to the remote server as
CMS_SMTP_HOSTNAME=gmail.com
## Can the From line be overridden in the outbound email
## NB GMail will rewrite the From address anyway so it's not important
## for GMail - YES/NO
CMS_SMTP_FROM_LINE_OVERRIDE=YES
## Which port should XMR listen on for Players?
XMR_PLAYER_PORT=9505
## Which port should the Xibo CMS Webserver listen on?
WEBSERVER_PORT=80

In addition to these environment parameters, you can also provide the connection details to the external database:

  • CMS_DATABASE_HOST
  • CMS_DATABASE_PORT
  • CMS_DATABASE_NAME
  • CMS_DATABASE_USERNAME
  • CMS_DATABASE_PASSWORD

Upgrading

Upgrading the containers is as simple as destroying them and bootstrapping again using the same DATA_DIR.

docker stop $INSTANCE_NAME-cms-web
docker stop $INSTANCE_NAME-cms-xmr
docker rm $INSTANCE_NAME-cms-web
docker rm $INSTANCE_NAME-cms-xmr

And then the commands from bootstrap.