Based on laradock.
It's made for having a PHP + DB environment quickly through docker-compose configuration. You can use any library or framework.
The workspace container gives you a basic Bash + PHP (with Composer) installation.
Install docker-compose.
You can create the environment cloning this repository inside your main repository:
# Cloning repository
git clone https://github.com/aboglioli/phpdock.git
cd phpdock
# Building the environment and setting it up.
# You can write mariadb instead of mysql if you want to use this.
# It can take a while (some minutes).
docker-compose up -d nginx mysql
# And access the workspace to install libraries or frameworks with composer
docker-compose exec workspace bash
/var/www
points to your root directory. It needs a public
folder where Nginx looks at.
Nginx and php-fpm WORKDIR
is /var/www/public
and your root directory
(where your application will be) outside phpdock is referenced with
/var/www
inside application container (application code container).
You have to make a directory called public/
inside the root directory.
It will have the root directory of your application. By this way, you can
include PHP files from the parent directory (../) to your code and that files
can't be accessed directly from the browser.
If you have problems, contact me: alan.boglioli@gmail.com If you improve this and you want to share it, send a Pull Request.
MIT License (MIT)