Public | Automated Build

Last pushed: 2 years ago
Short Description
Short description is empty for this repo.
Full Description


Includes nginx and php5 running with supervisor

To build

$ sudo docker build -t yourname/nginx-php .

To run

Nginx will look for files in /var/www so you need to map your application to that directory.

sudo docker run -d -p 8000:80 --volumes-from APPDATA -v /home/me/myphpapp:/var/www --name lemp yourname/nginx-php

The --volumes-from argument means that you're using a Data-only container pattern.

If you want to link the container to a MySQL/MariaDB contaier do:

sudo docker run -d -p 8000:80 --volumes-from APPDATA -v /home/me/myphpapp:/var/www --name lemp my_mysql_container:mysql yourname/nginx-php

The script will add the environment variables with MYSQL_ to /etc/php5/fpm/pool.d/env.conf so PHP-FPM detects them. If you need to use them you can do:

Testing that it works

Go to http://ip:port/test and you should see the output of phpinfo()


Credit to: Nian Wang
Original work can be found at:


The original author didn't relase the code with a License. But this code is released under the MIT License.

Docker Pull Command
Source Repository