<commit_before># Envplate

[![Build Status](https://travis-ci.org/yawn/envplate.svg)](https://travis-ci.org/yawn/envplate)

Trivial templating for configuration files using environment keys:

1. Keys are defined as `${key}` in various configuration files (glob patterns work)
* Definitions without a value result in an error
* envplate can optionally
	* create backups using the `-b` flag, appending a `.bak` extension to backup copies
	* output to stdout instead of replacing values in files using the `-d` flag
	* be verbose about it's operations by using the `-v` flag
  * `exec()` another command by passing `--` after all arguments to `ep`, the path to the binary and arguments to it, e.g. `/usr/local/ep -v *.conf -- /usr/sbin/nginx -c /etc/nginx.conf`; this can be used to use envplate to parse configs and execute the container process using Dockers `CMD`

Example:

```
$ cat /etc/foo.conf
Database=${FOO_DATABASE}
Mode=fancy

$ export FOO_DATABASE=db.example.com

$ ep /etc/f*.conf

$ cat /etc/foo.conf
Database=db.example.com
Mode=fancy
```

## Why?

For apps running Docker which rely (fully or partially) on configuration files instead of being purely configured through environment variables.

You can directly download envplate binaries into your Dockerfile using Github releases like this:

```
RUN curl -sLo /usr/local/bin/ep https://github.com/yawn/envplate/releases/download/v0.0.2/ep-linux && chmod +x /usr/local/bin/ep

...

CMD /usr/local/bin/ep -v /etc/nginx/nginx.conf -- /usr/sbin/nginx -c /etc/nginx/conf
```<commit_msg>Fixed Dockerfile syntax in README.<commit_after># Envplate

[![Build Status](https://travis-ci.org/yawn/envplate.svg)](https://travis-ci.org/yawn/envplate)

Trivial templating for configuration files using environment keys:

1. Keys are defined as `${key}` in various configuration files (glob patterns work)
* Definitions without a value result in an error
* envplate can optionally
	* create backups using the `-b` flag, appending a `.bak` extension to backup copies
	* output to stdout instead of replacing values in files using the `-d` flag
	* be verbose about it's operations by using the `-v` flag
  * `exec()` another command by passing `--` after all arguments to `ep`, the path to the binary and arguments to it, e.g. `/usr/local/ep -v *.conf -- /usr/sbin/nginx -c /etc/nginx.conf`; this can be used to use envplate to parse configs and execute the container process using Dockers `CMD`

Example:

```
$ cat /etc/foo.conf
Database=${FOO_DATABASE}
Mode=fancy

$ export FOO_DATABASE=db.example.com

$ ep /etc/f*.conf

$ cat /etc/foo.conf
Database=db.example.com
Mode=fancy
```

## Why?

For apps running Docker which rely (fully or partially) on configuration files instead of being purely configured through environment variables.

You can directly download envplate binaries into your Dockerfile using Github releases like this:

```
RUN curl -sLo /usr/local/bin/ep https://github.com/yawn/envplate/releases/download/v0.0.2/ep-linux && chmod +x /usr/local/bin/ep

...

CMD [ "/usr/local/bin/ep", "-v", "/etc/nginx/nginx.conf", "--", "/usr/sbin/nginx", "-c", "/etc/nginx/conf" ]
```
{'fraction_non_alphanumeric': 0.1240038253108065, 'fraction_numerical': 0.002550207204335352, 'mean_word_length': 4.012779552715655, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2030028', 'n_tokens_mistral': 1035, 'n_tokens_neox': 995, 'n_words': 362}