Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
local
.idea/
testrail-*.zip
41 changes: 23 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
FROM ubuntu:trusty
FROM php:7.2.16-apache-stretch

RUN apt-get update && apt-get install -y --no-install-recommends \
php5 php5-cli php5-mysql php5-curl \
mysql-server \
curl \
unzip \
&& rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y \
unzip \
cron \
supervisor

RUN curl -O http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64_5.1.2.tar.gz && \
tar vxfz ioncube_loaders_lin_*.tar.gz && \
RUN docker-php-ext-install mysqli

RUN mkdir /ioncube && \
curl -O https://downloads.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz && \
tar vxfz ioncube_loaders_lin_*.tar.gz -C / && \
rm -f ioncube_loaders_lin_*.tar.gz

RUN echo "zend_extension=/ioncube/ioncube_loader_lin_5.5.so" > /etc/php5/cli/php.ini.new && \
cat /etc/php5/cli/php.ini >> /etc/php5/cli/php.ini.new && \
mv /etc/php5/cli/php.ini.new /etc/php5/cli/php.ini && \
echo "zend_extension=/ioncube/ioncube_loader_lin_5.5.so" > /etc/php5/apache2/php.ini.new && \
cat /etc/php5/apache2/php.ini >> /etc/php5/apache2/php.ini.new && \
mv /etc/php5/apache2/php.ini.new /etc/php5/apache2/php.ini
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"

RUN echo "zend_extension=/ioncube/ioncube_loader_lin_7.2.so" >> $PHP_INI_DIR/php.ini

COPY testrail-*.zip /
RUN cd /var/www/html && unzip -q /testrail-*.zip

COPY config.php /var/www/html/testrail/config.php
COPY testrail.sql /
COPY run.sh /

CMD /run.sh
RUN mkdir /var/www/html/testrail/logs && \
chown www-data /var/www/html/testrail/logs

RUN echo '* * * * * www-data php /var/www/html/testrail/task.php' >> /etc/crontab

EXPOSE 80

ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf

ENTRYPOINT ["/usr/bin/supervisord"]
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,33 @@ Run [TestRail](http://www.gurock.com/testrail/) in a Docker container, for testi

## Prerequisites

1. Download your version of TestRail from their website, and put it in the current directory (e.g. `testrail-5.3.0.3603-ion53.zip`).
1. Download your version of TestRail from their website, and put it in the current directory (e.g. `testrail-5.6.x-ion53.zip`).
1. Have your TestRail license key ready. You will need it later.

This repository includes a minimal database dump (`testrail.sql`) that can be used as a starting point.
If you want to use your own data, you can dump your existing TestRail database server and replace `testrail.sql` with the contents.
For example:

mysqldump testrail > testrail.sql
If you want to use your own data, you can dump your existing TestRail database server and replace `data/testrail.sql` with the contents.
See mysql image documentation about data import for more.

## Build the Image

To build the image:

docker build -t testrail .

## Run the Container
## Run the Container

./start_container.sh
docker-compose up

## Usage

Browse to:

http://localhost:7070/testrail/
http://localhost:8123/testrail/

To log in:

- Email address: `admin@admin.com`
- Password: `admin`

Problems:
- migrate existing assets (screenshots, reports?) located in same dir where testrail code
2 changes: 1 addition & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

define('DB_DRIVER', 'mysql'); // sqlsrv or mysql
define('DB_HOSTNAME', 'localhost');
define('DB_HOSTNAME', 'mysql');
define('DB_DATABASE', 'testrail');
define('DB_USERNAME', 'testrail');
define('DB_PASSWORD', 'newpassword');
Expand Down
File renamed without changes.
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3.5'
services:
mysql:
container_name: mysql
image: mysql/mysql:5.5.60
ports:
- "3306:3306"
volumes:
- ./data:/docker-entrypoint-initdb.d
environment:
- MYSQL_USER=testrail
- MYSQL_PASSWORD=newpassword
- MYSQL_ROOT_PASSWORD=newpassword
- MYSQL_DATABASE=testrail
testrail:
container_name: testrail
image: testrail:latest
ports:
- "8123:80"
# links:
# - mysql
17 changes: 0 additions & 17 deletions run.sh

This file was deleted.

1 change: 0 additions & 1 deletion start_container.sh

This file was deleted.

8 changes: 8 additions & 0 deletions supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[supervisord]
nodaemon=true

[program:cron]
command=cron -f

[program:apache2]
command=apache2-foreground