Installation on Docker: Compose files
It’s suggested to create a local .env file, to specify user- or machine-specific variables (for more information, see here). The syntax is simple: e.g. ‘HTTP_PORT=8000’
Environment variables can also be set directly in the shell with the same syntax and then using
- DB_URL (e.g. http://internal.yourcompany.com/5.7.sql)
Pre-populated databases and TestRail’s config.php
DB_URL variable, it’s also possible to provide a SQL-dump to be downloaded by the container, so TestRail is already pre-configured. For proper functionality, the
config.php file needs to be provided. Simply copy it into the
_config folder. Ensure that the values in the
config.php file match the database settings for user and password, which are specified in the compose file for the db.
Using Compose files
docker-compose up docker-compose down
up starts the container; while
down stops everything. The
docker-compose CLI reference can be found here.
Additional useful options:
||This is important to remove temporary volumes after shutdown and is recommended to be used. If the volumes should not be purged, don’t use this parameter. However, be aware that this might still cause some side effects.|
||Can be used to specify a different compose file (by default docker-compose.yml is used)|
||Required if multiple TestRail instances should be started. Otherwise,
The name of the folder docker-compose is started in (in this case, ‘internal-docker’) is used as a project name and is prepended to all spawned containers.
docker-compose down -v, as it removes named and anonymous volumes!
General remarks on the compose files
- All compose files rely on additional volumes:
testrail_rootcontains the installation and gets mounted to
testrail_optcontains uploaded files etc. and gets mounted to
testrail_dbcontains the database and gets mounted to
testrail_configcontains the config.php file, which configures TestRail and is mounted to
Containers are connected though a
testrail bridged network. Start-order is important – php needs to be first, followed by webserver and DB.