<commit_before>docker-php
==========

Provides basic building blocks for PHP web applications, available on Docker Hub: https://hub.docker.com/r/bryanlatten/docker-php/

Three variants are available:
- (default) Ubuntu-based, PHP 7.0  
- (slim) Alpine-based, PHP 7.0, tagged as `-alpine`  
- (beta) Ubuntu-based, PHP 7.1, tagged as `-beta`  

###Includes
---
- Nginx
- PHP/PHP-FPM (7.0)
- Extra PHP Modules:

`*` - not available on Alpine variant  
`**` - backwards compatible library not available on Alpine variant  
`^` - not available on beta tag
  - apcu**^
  - bz2^
  - ctype
  - curl
  - dom
  - exif
  - fpm
  - gd
  - gearman*
  - iconv
  - igbinary*^
  - intl
  - json
  - mbstring
  - mcrypt
  - memcache*^
  - memcached^
  - mysqli
  - mysqlnd
  - newrelic (disabled, activated by env variables)
  - opcache (can be disabled with debug env variable)
  - openssl
  - pcntl
  - pdo
  - pdo_mysql
  - phar
  - posix
  - shmop
  - SimpleXML
  - sockets
  - sysvmsg
  - sysvsem
  - sysvshm
  - xml
  - xmlreader
  - xmlwriter
  - zip
  - zlib
  - xdebug (disabled by default)


###Expectations
---
Applications that leverage `bryanlatten/docker-php` as their container parent are expected to copy their application into `/app`, for example:
```COPY ./ /app/```

Inside the copied directory, there must be a directory named `public` -- this will be automatically assigned as the webroot for the web server, which expects
a front controller called `index.php`.


NOTE: Nginx is exposed and bound to an unprivileged port, `8080`


###Downstream Configuration
---
Several environment variables can be used to configure various PHP FPM paramaters, as well as a few Nginx configurations.
as such. These can be used to drive the configuration of the downstream PHP application in any way necessary, but there are a few environment variables that `bryanlatter/docker-php` will process along the way...

Variable | Example | Description
--- | --- | ---
`CFG_*` | `CFG_DATABASE_USERNAME=root` | PHP has access as an environment variable
`CFG_APP_DEBUG` | `CFG_APP_DEBUG=1` | Setting to `1` or `true` will cue the Opcache to watch for file changes. Otherwise, the Opcache check is skipped for a performance boost.
`SERVER_MAX_BODY_SIZE` | `SERVER_MAX_BODY_SIZE=4M` | Allows the downstream application to specify a non-default `client_max_body_size` configuration for the `server`-level directive in `/etc/nginx/sites-available/default`
`REPLACE_NEWRELIC_APP` | `REPLACE_NEWRELIC_APP=prod-server-abc` | Sets application name for newrelic
`REPLACE_NEWRELIC_LICENSE` | `REPLACE_NEWRELIC_LICENSE=abcdefg` | Sets license for newrelic, when combined with above, will enable newrelic reporting
`PHP_FPM_MEMORY_LIMIT` | `PHP_FPM_MEMORY_LIMIT=256M` | Sets memory limit for FPM instances of PHP
`PHP_FPM_MAX_EXECUTION_TIME` | `PHP_FPM_MAX_EXECUTION_TIME=60` | Sets time limit for FPM workers<commit_msg>README: added pgsql / pdo_pgsql to docs<commit_after>docker-php
==========

Provides basic building blocks for PHP web applications, available on Docker Hub: https://hub.docker.com/r/bryanlatten/docker-php/

Three variants are available:
- (default) Ubuntu-based, PHP 7.0  
- (slim) Alpine-based, PHP 7.0, tagged as `-alpine`  
- (beta) Ubuntu-based, PHP 7.1, tagged as `-beta`  

###Includes
---
- Nginx
- PHP/PHP-FPM (7.0)
- Extra PHP Modules:

`*` - not available on Alpine variant  
`**` - backwards compatible library not available on Alpine variant  
`^` - not available on beta tag
`~` - disabled by default
  - apcu**^
  - bz2^
  - ctype
  - curl
  - dom
  - exif
  - fpm
  - gd
  - gearman*
  - iconv
  - igbinary*^
  - intl
  - json
  - mbstring
  - mcrypt
  - memcache*^
  - memcached^
  - mysqli
  - mysqlnd
  - newrelic~ (activates with env variables)
  - opcache (can be disabled with debug env variable)
  - openssl
  - pcntl
  - pdo
  - pdo_mysql
  - pdo_pgsql~
  - pgsql~
  - phar
  - posix
  - shmop
  - SimpleXML
  - sockets
  - sysvmsg
  - sysvsem
  - sysvshm
  - xml
  - xmlreader
  - xmlwriter
  - zip
  - zlib
  - xdebug~


###Expectations
---
Applications that leverage `bryanlatten/docker-php` as their container parent are expected to copy their application into `/app`, for example:
```COPY ./ /app/```

Inside the copied directory, there must be a directory named `public` -- this will be automatically assigned as the webroot for the web server, which expects
a front controller called `index.php`.


NOTE: Nginx is exposed and bound to an unprivileged port, `8080`


###Downstream Configuration
---
Several environment variables can be used to configure various PHP FPM paramaters, as well as a few Nginx configurations.
as such. These can be used to drive the configuration of the downstream PHP application in any way necessary, but there are a few environment variables that `bryanlatter/docker-php` will process along the way...

Variable | Example | Description
--- | --- | ---
`CFG_*` | `CFG_DATABASE_USERNAME=root` | PHP has access as an environment variable
`CFG_APP_DEBUG` | `CFG_APP_DEBUG=1` | Setting to `1` or `true` will cue the Opcache to watch for file changes. Otherwise, the Opcache check is skipped for a performance boost.
`SERVER_MAX_BODY_SIZE` | `SERVER_MAX_BODY_SIZE=4M` | Allows the downstream application to specify a non-default `client_max_body_size` configuration for the `server`-level directive in `/etc/nginx/sites-available/default`
`REPLACE_NEWRELIC_APP` | `REPLACE_NEWRELIC_APP=prod-server-abc` | Sets application name for newrelic
`REPLACE_NEWRELIC_LICENSE` | `REPLACE_NEWRELIC_LICENSE=abcdefg` | Sets license for newrelic, when combined with above, will enable newrelic reporting
`PHP_FPM_MEMORY_LIMIT` | `PHP_FPM_MEMORY_LIMIT=256M` | Sets memory limit for FPM instances of PHP
`PHP_FPM_MAX_EXECUTION_TIME` | `PHP_FPM_MAX_EXECUTION_TIME=60` | Sets time limit for FPM workers
{'fraction_non_alphanumeric': 0.09763212079615649, 'fraction_numerical': 0.007206588881262869, 'mean_word_length': 3.633545310015898, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '4451804', 'n_tokens_mistral': 2010, 'n_tokens_neox': 1886, 'n_words': 657}