<commit_before># Nginx / PHP docker image for development environment

A Docker Nginx / PHP-FPM image with some useful packages for development environments.
Do not use it for production.


## Configuration

Nginx, php5, Xdebug, composer, phpunit, phing

Nginx serve a phpinfo() page. To test it and obtain information about the configuration:

    docker run -d -p 80:80 -p 443:443 alexisno/nginx-php-dev

* `docker run ... alexisno/nginx-php-dev` Run Nginx and PHP-FPM in a new container
* `-d` Detached mode: run container in the background
* `-p 80:80 -p 443:443` Publish the container's ports 80 and 443 on the host so you can connect to the server

Open your brower at http://localhost/ and https://localhost/

Composer, phpunit and phing are available globally.

PHP is configured to send mail via a [`alexisno/mailcatcher-dev`](https://github.com/AlexisNo/docker-mailcatcher-dev) container.
Launch a [`alexisno/mailcatcher-dev`](https://github.com/AlexisNo/docker-mailcatcher-dev) container and use `--link mailcatcher:my-mailcatcher-container`.

Xdebug is configurated to accept any connection. Just send the appropriate request parameters.


## Common usage

This image should be used as a basic image for any project.

* Create an apache virtualhost for the development environment.
* Create a Dockerfile with your project dependencies and add the virtualhost to it's configuration.
* Create you own image with `docker build` or `docker-compose build`.

Run your new image with a command similar to this:

    docker run -d -p 80:80 -p 443:443 -v /path/to/your/project/sources:/var/www/project-name -v /path/to/project/data/apache/logs:/var/log/apache2 your-image-tag


## Self signed certificate

The image comes with a `gencert` command to generate self signed certificates.

Usage in child Dockerfile:

    RUN gencert <domain>

VirtualHost configuration:

  server {
      listen 80;
      listen 443 ssl;

      ssl_certificate     /etc/ssl/certs/<domain>.crt;
      ssl_certificate_key /etc/ssl/private/<domain>.key;

      server_name <domain>;

      # Complete with your configuration
      # ...<commit_msg>Correct typo breaking code highlighting<commit_after># Nginx / PHP docker image for development environment

A Docker Nginx / PHP-FPM image with some useful packages for development environments.
Do not use it for production.


## Configuration

Nginx, php5, Xdebug, composer, phpunit, phing

Nginx serve a phpinfo() page. To test it and obtain information about the configuration:

    docker run -d -p 80:80 -p 443:443 alexisno/nginx-php-dev

* `docker run ... alexisno/nginx-php-dev` Run Nginx and PHP-FPM in a new container
* `-d` Detached mode: run container in the background
* `-p 80:80 -p 443:443` Publish the container's ports 80 and 443 on the host so you can connect to the server

Open your brower at http://localhost/ and https://localhost/

Composer, phpunit and phing are available globally.

PHP is configured to send mail via a [`alexisno/mailcatcher-dev`](https://github.com/AlexisNo/docker-mailcatcher-dev) container.
Launch a [`alexisno/mailcatcher-dev`](https://github.com/AlexisNo/docker-mailcatcher-dev) container and use `--link mailcatcher:my-mailcatcher-container`.

Xdebug is configurated to accept any connection. Just send the appropriate request parameters.


## Common usage

This image should be used as a basic image for any project.

* Create an apache virtualhost for the development environment.
* Create a Dockerfile with your project dependencies and add the virtualhost to it's configuration.
* Create you own image with `docker build` or `docker-compose build`.

Run your new image with a command similar to this:

    docker run -d -p 80:80 -p 443:443 -v /path/to/your/project/sources:/var/www/project-name -v /path/to/project/data/apache/logs:/var/log/apache2 your-image-tag


## Self signed certificate

The image comes with a `gencert` command to generate self signed certificates.

Usage in child Dockerfile:

    RUN gencert <domain>

VirtualHost configuration:

    server {
      listen 80;
      listen 443 ssl;

      ssl_certificate     /etc/ssl/certs/<domain>.crt;
      ssl_certificate_key /etc/ssl/private/<domain>.key;

      server_name <domain>;

      # Complete with your configuration
      # ...
{'fraction_non_alphanumeric': 0.08636788048552754, 'fraction_numerical': 0.0196078431372549, 'mean_word_length': 3.734806629834254, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 6, 'lorem ipsum': 0, 'www.': 2, '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': '7332324', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1219, 'n_words': 500}