<commit_before>## Docker README

Docker is used to run all the services and apps in a consistent way for both development and production.

**For most changes you can just run the code directly / use the unit tests - no need to run the Docker**

### Installation on Ubuntu 17.04

* Install latest Docker:
  * sudo apt-get remove docker docker-engine docker-compose docker.io
  * sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  * curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  * sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
  * sudo apt-get update
  * sudo apt-get install docker-ce
* Install Docker compose
  * curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null
  * sudo chmod +x /usr/local/bin/docker-compose
* fix Docker permissions
  * usermod -aG docker $USER
  * sudo su -l $USER
  * docker ps
  * restart to make sure group change takes effect
* clean start
  * make docker-clean-start

### Modifying configurations

* `cp docker-compose.override.yml.example docker-compose.override.yml`
* modify docker-compose.override.yml
* you can override all settings in docker-compose.yml

### Connecting to local ElasticSearch instance for development

If you have a local ES you want to test with:

* Find out the docker network
  * On Ubuntu 17.04:
    * `sudo ifconfig -a`
    * should get something like this:
      * `docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500`
      * `inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0`
    * the relevant host IP is 172.17.0.1
* Expose Elasticsearch to the docker network
  * edit /etc/elasticsearch/elasticsearch.yml<commit_msg>Create README-DOCKER.md<commit_after>## Docker README

Docker is used to run all the services and apps in a consistent way for both development and production.

**For most changes you can just run the code directly / use the unit tests - no need to run the Docker**

### Installation on Ubuntu 17.04

* [Install Docker](https://docs.docker.com/engine/installation/) (tested with version 17.03)
  * sudo apt-get remove docker docker-engine docker-compose docker.io
  * sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
  * curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  * sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable"
  * sudo apt-get update
  * sudo apt-get install docker-ce
* [Install Docker Compose](https://docs.docker.com/compose/install/)
  * curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` | sudo tee /usr/local/bin/docker-compose > /dev/null
  * sudo chmod +x /usr/local/bin/docker-compose
* fix Docker permissions
  * usermod -aG docker $USER
  * sudo su -l $USER
  * docker ps
  * restart to make sure group change takes effect
* clean start
  * make docker-clean-start

### Modifying configurations

* `cp docker-compose.override.yml.example docker-compose.override.yml`
* modify docker-compose.override.yml
* you can override all settings in docker-compose.yml

### Connecting to local ElasticSearch instance for development

If you have a local ES you want to test with:

* Find out the docker network
  * On Ubuntu 17.04:
    * `sudo ifconfig -a`
    * should get something like this:
      * `docker0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500`
      * `inet 172.17.0.1  netmask 255.255.0.0  broadcast 0.0.0.0`
    * the relevant host IP is 172.17.0.1
* Expose Elasticsearch to the docker network
  * edit /etc/elasticsearch/elasticsearch.yml
{'fraction_non_alphanumeric': 0.10383386581469649, 'fraction_numerical': 0.027156549520766772, 'mean_word_length': 3.6041666666666665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 8, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4391784', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1167, 'n_words': 395}