<commit_before>Dockerised Pact Broker
==================

This repository deploys Pact Broker using lightweight containers using Docker.

##Prerequisites##
* A running postgres database and the ability to connect to it

##Getting Started##
1. [Install Docker](https://docs.docker.com/installation/)
2. Prepare your environment

	a. If running on OSX, run **fix_b2d_ports.sh** to forward the web port from the boot2docker vm. 	
		**You need to shutdown boot2docker before you run this script.**
	
	b. Setup the pact broker connection to the database through the use of the following environment variables
       * PACT_BROKER_DATABASE_USERNAME
       * PACT_BROKER_DATABASE_PASSWORD
       * PACT_BROKER_DATABASE_HOST
       * PACT_BROKER_DATABASE_NAME
3. Build the pact broker environment by executing **build.sh**
4. You're now ready to go!

##Notes##
* On all environments except for OSX - you can access the pact broker web interface on the default web port.
* On OSX you need to use 8080 due to boot2docker's virtual box generally not having the right priviliges to start a new process listing to default web port.
* Currently, the application makes use of thin, but you can update the Gemfile to use any application server you like.
* As the native dependencies for a postgres driver are baked into the docker container, you are limited to using postgres as a database. 
* Apart from creating a postgres database no futher prepartion is required.
<commit_msg>adding README for publishing steps<commit_after>Dockerised Pact Broker
==================

This repository deploys Pact Broker using lightweight containers using Docker.

##Prerequisites##
* A running postgres database and the ability to connect to it

##Getting Started##
1. [Install Docker](https://docs.docker.com/installation/)
2. Prepare your environment

	a. If running on OSX, run **fix_b2d_ports.sh** to forward the web port from the boot2docker vm. 	
		**You need to shutdown boot2docker before you run this script.**
	
	b. Setup the pact broker connection to the database through the use of the following environment variables
       * PACT_BROKER_DATABASE_USERNAME
       * PACT_BROKER_DATABASE_PASSWORD
       * PACT_BROKER_DATABASE_HOST
       * PACT_BROKER_DATABASE_NAME
3. Build the pact broker environment by executing **build.sh**
4. You're now ready to go!

##Notes##
* On all environments except for OSX - you can access the pact broker web interface on the default web port.
* On OSX you need to use 8080 due to boot2docker's virtual box generally not having the right priviliges to start a new process listing to default web port.
* Currently, the application makes use of thin, but you can update the Gemfile to use any application server you like.
* As the native dependencies for a postgres driver are baked into the docker container, you are limited to using postgres as a database. 
* Apart from creating a postgres database no futher prepartion is required.


##Publishing to Docker Hub##
1. Login to docker hub from console

```
docker login
```

This will prompt for your docker hub credentials and email

2. Build the docker image for the dius account

```
docker build -t=dius/pact_broker_img .
```

3. Publish to docker hub (dius organisation)

```
docker push dius/pact_broker_img
```
{'fraction_non_alphanumeric': 0.06461444681499542, 'fraction_numerical': 0.008229198415117342, 'mean_word_length': 4.285024154589372, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4452912', 'n_tokens_mistral': 963, 'n_tokens_neox': 883, 'n_words': 445}