docker/docker-compose/README.md
These reference docker-compose files will run Tinode with the MySql backend either as a single-instance or a 3-node cluster setup.
docker-compose -f <name of the file> [-f <name of override file>] up -d
By default, this command starts up a mysql instance, Tinode server(s) and Tinode exporter(s). Tinode server(s) is(are) configured similar to Tinode Demo/Sandbox and maps its web port to the host's port 6060 (6061, 6062). Tinode exporter(s) serve(s) metrics for InfluxDB.
Reference configuration for the following databases is also available in the override files:
To bring up the full stack, you can use the following commands:
docker-compose -f single-instance.yml up -ddocker-compose -f cluster.yml up -ddocker-compose -f single-instance.yml -f single-instance.postgres.yml up -ddocker-compose -f cluster.yml -f cluster.postgres.yml up -ddocker-compose -f single-instance.yml -f single-instance.mongodb.yml up -ddocker-compose -f cluster.yml -f cluster.mongodb.yml up -ddocker-compose -f single-instance.yml -f single-instance.rethinkdb.yml up -ddocker-compose -f cluster.yml -f cluster.rethinkdb.yml up -dYou can run individual/separate components of the setup by providing their names to the docker-compose command.
E.g. to start the Tinode server in the single-instance MySql setup,
docker-compose -f single-instance.yml up -d tinode-0
To reset the database or upgrade the database version, you can set RESET_DB or UPGRADE_DB environment variable to true when starting Tinode with docker-compose.
E.g. for upgrading the database in MongoDb cluster setup, use:
UPGRADE_DB=true docker-compose -f cluster.yml -f cluster.mongodb.yml up -d tinode-0
For resetting the database in RethinkDb single-instance setup, run:
RESET_DB=true docker-compose -f single-instance.yml -f single-instance.rethinkdb.yml up -d tinode-0
Print out and verify your docker-compose configuration by running:
docker-compose -f <name of the file> [-f <name of override file>] config
If the Tinode server(s) are failing, you can print the job's stdout/stderr with:
docker logs tinode-<instance number>
Additionally, you can examine the jobs tinode.log file. To download it from the container, run:
docker cp tinode-<instance number>:/var/log/tinode.log .