Thanks to Eric Rasche of Texas A&M / CPT and Anthony Bretaudeau of INRA, a docker image for a base Tripal site is now available. The Docker image is located on GitHub at this location: https://github.com/erasche/docker-tripal.
Installation of the Docker image will allow for quick setup of Tripal with considerable time saving. Their docker application consists of three containers: one for Drupal and Tripal, another for PostgreSQL (in which Tripal stores data) and an optional container for ElasticSearch for fast indexing and querying of data in Tripal. The following instructions will setup the container with default settings.
Before proceeding both Docker and Docker-compose must be installed. Installation instructions for each tool can be found at the following links:
- Docker provides instructions for installation on a variety of Linux distributions.
- Docker-compose provides instructions for the installation on a variety of platforms as well.
Install the Tripal Application
Once Docker and Docker-compose are installed you must create a docker-compose.yml file describing how to launch the Tripal Docker application. A ready to use example is available from https://github.com/erasche/docker-tripal. Navigate to an empty working directory and issue the following command:
This will install the most recent development version of the example docker-compose.yml file. Currently there is not a stable release for Tripal v2.1 so we'll use the development branch. However this may mean that at any given point in time, until the stable version is released this instructions may not work. Please report a problem if you encounter one.
Once the file is downloaded, you are ready to launch the docker containers. Do so by entering the directory and issuing the docker-compose command:
sudo docker-compose up
This process will take up to several minutes to complete. Once finished you should then be able to view your Tripal site at this URL: http://localhost:3000/tripal. Keep in mind that any URLs in the remainder of the tutorial may be listed simply as http://localhost. Because we have installed the Docker image we must mentally substitute the http://localhost:3000/tripal URL.
Throughout this tutorial there are times when access to the command-line is desired.
The easiest method is to run the following command from the working directory:
sudo docker-compose exec -it web bash
Similarly, you can get command-line access to the two other containers by running one of these 2 commands:
sudo docker-compose exec -it db bash
sudo docker-compose exec -it elasticsearch bash
Another option exists to obtain access to the container containing the Tripal site: we must first find the container name. The following command will list all of the active containers:
sudo docker ps
Output similar to the following will be printed to the screen:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES b1764039943f erasche/tripal:latest "/usr/local/bin/ti..." 6 minutes ago Up 6 minutes 0.0.0.0:3000->80/tcp dockertripal_web_1 36718e982c8c erasche/chado:1.31-jenkins97-pg9.5 "/docker-entrypoin..." 6 minutes ago Up 6 minutes 5432/tcp dockertripal_db_1 c28145021680 elasticsearch "/docker-entrypoin..." 6 minutes ago Up 6 minutes 9200/tcp, 9300/tcp dockertripal_elasticsearch_1
sudo docker exec -it dockertripal_web_1 /bin/bash
You can connect to any of the three Docker containers by changing the name in the command.
Advanced configuration of the containers
To run a Tripal instance in production, you will probably want to modifiy the configuration of the 3 containers. To do this, you just need to open the docker-compose.yml file and adapt it to your needs.
The exact syntax of this file is describe in the Docker-compose documentation. A description of the things you can configure in the Tripal container is available on https://github.com/erasche/docker-tripal.