This is a basic LEMP stack environment built using Docker Compose. It consists following:
- PHP-FPM
- Nginx
- MySQL 5.7
- PhpMyAdmin
- Redis
As of now, we have 5 different branches for different PHP-FPM versions. Use appropriate branch as per your php-fpm version need:
Code in www directory can execute different php-fpm version based on nginx configuration.
example.com example2.com
| |
|php-fpm:7.3.x |php-fpm:7.2.x
| |
───────────────────────────────────
|
www
Clone this repository on your local computer and checkout the appropriate branch e.g. 7.x.x. Run the docker-compose up -d
.
git clone https://github.com/gehlotanish/docker-php-fpm.git
cd docker-php/
git fetch --all
cd bin/
bash install-docker.sh
bash install-docker-compose.sh
git checkout fpm-7.x.x
docker-compose up -d
Your LEMP stack is now ready!! You can access it via http://localhost
.
You can connect to web server using docker exec
command to perform various operation on it. Use below command to login to container via ssh.
docker exec -it webserver /bin/bash
docker exec -it mysql /bin/bash
This package comes with default configuration options. You can modify them by creating .env
file in your root directory.
To make it easy, just copy the content from sample.env
file and update the environment variable values as per your need.
phpMyAdmin is configured to run on port 8000. Use following default url.
http://localhost:8000/
It comes with Redis. It runs on default port 6379
.
Please read from appropriate version branch.