<commit_before>This repository has the scripts used to build tsuru's base docker image.
Keep reading for better understanding what that image does and how to create
your own image for tsuru to use.


Why this image?
---------------

Tsuru will need to perform some actions in the containers created by docker.
This image have a built-in delpoyment script, which will also run the
requirements.apt file (`so_requirements` file). So if you want to build your own
platform base image you would have to provide this by yourself. This is one of
the matters this repository aims to solve.

In order to create a base image for a platform (let's say you wanna add
support for php, for instance) you'll use tsuru's base image as your base
image, this will give you the hooks tsuru will need to work properly.


Hooks explained
---------------

This image has two implemented scripts:

 - deploy
 - so_dependencies

The `deploy` hook receives the application git read-only url. It will clone
the repository into the `$CURRENT_DIR` environment defined in the config file.
If this directory already exists, the script will simply run a `git pull`
inside `$CURRENT_DIR`. This script will also call the `so_dependencies` function,
defined in the `so_dependencies` file.
The `so_dependencies` script is for installing OS requirements, this is not
platform dependent, then it serves for any kind of application.

Making your own docker image
----------------------------

To add support for platforms tsuru does not have built-in support, one must
create images. Simple create a container using tsuru base image and install
everything your platform needs to run. When you're done, commit and push the
image to docker registry. You might have to change some of the default scripts,
for example, if you need to search platform specific dependencies (and you
probably will), you'll have to call your custom dependencies seeker in the
deploy script, which is the only one called directly by tsuru in deployment
time.<commit_msg>DOC: Improve a little README.md<commit_after>This repository has the scripts used to build tsuru's docker images.
Keep reading for better understanding what that image does and how to create
your own image for using at tsuru.


Why this image?
---------------

Tsuru performs some actions in the containers created by docker.
Each image has a built-in deployment script, which also runs the
requirements.apt file (`so_requirements` file). If none of the default
images attends your needs, you have to customize an image.
This repository aims to make this process easier.

In order to create a base image for a platform (let's say you wanna add
support for php, for instance) you can use tsuru's base image as your base
image, and addapt to your needs. Implementing the hooks (described below)
will allow tsuru to run php apps properly.


Hooks explained
---------------

Images must have two scripts (or hooks):

 - deploy
 - so_dependencies

The `deploy` hook receives the application git read-only url. It will clone
the repository into the `$CURRENT_DIR` environment defined in the config file.
If the directory already exists, the script will simply run a `git pull`
inside `$CURRENT_DIR`. This script will also call the `so_dependencies` function,
defined in the `so_dependencies` file.
The `so_dependencies` script is intended to install OS requirements. It is not
platform dependent and, therefore, can be used for any kind of application.

Making your own docker image
----------------------------

To add support for platforms tsuru does not have built-in support, one must
create images. Simply create a container using tsuru base image and install
everything your platform needs to run. When you're done, commit and push the
image to docker registry. You might have to change some of the default scripts.
For example, if you need to search platform specific dependencies (and you
will probably need), you'll have to call your custom dependencies seeker in the
deploy script, which is the only one called directly by tsuru in deployment
time.
{'fraction_non_alphanumeric': 0.06502463054187192, 'fraction_numerical': 0.0, 'mean_word_length': 3.910519951632406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '1805394', 'n_tokens_mistral': 1006, 'n_tokens_neox': 952, 'n_words': 629}