Adding Additional Docker Containers - Pilothouse-App/Pilothouse GitHub Wiki
First, create a new file in the Pilothouse home directory (~/.pilothouse
) named docker-compose.custom.yml
. Anything you add to this file will extend the core docker-compose.yml file. You can use any of the available docker-compose configuration directives, and you should familiarize yourself with the way docker-compose configuration sharing works.
The only thing required in the file is the config version, which needs to match the config version currently in use by Pilothouse, which is 2.
version: '2'
After the config version, add any additional container or configuration directives you need.
For example, let's add an Elasticsearch service to our stack. Here is what your docker-compose.custom.yml file would look like:
version: '2'
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:5.2.0
ports:
- 9200:9200
volumes:
- esdata:/usr/share/elasticsearch/data
volumes:
esdata:
driver: local
This tells Docker to add a new container to the stack based on the Elasticsearch 5.2 image, using persistent storage. Run pilothouse restart
to download and start the new container.
You can then access the new container's service from any of the other containers by using the service name from the configuration file, which in this example is simply elasticsearch
.
Note 1: The Elasticsearch container requires a significant amount of RAM to be available. If your Elasticsearch container fails to start with Exit 137
showing as the state when running pilothouse compose ps
, increase the amount of RAM allocated to Docker in the Docker settings.
Note 2: The Elasticsearch image has HTTP Basic Authentication enabled by default. The default username/password is elastic
/changeme
. You can define this for ElasticPress by adding the following to your wp-config.php:
define( 'EP_HOST', 'http://elasticsearch:9200' );
define( 'ES_SHIELD', 'elastic:changeme' );