This is a development suite for development with PHP. It can be easily deployed with 1 or 2 commands. It includes:
- Nginx (
nginx_mainfor serving as a proxy server) - PHP-FPM (
php72_fpm,php_latest_fpmfor executing PHP scripts via FastCGI of Nginx) - MySQL (
mysql57,mysql80database, we have 5.7 for the stable and 8.0 is latest one) - PhpMyAdmin (
phpmyadmintool for managing database)
For now, this project has been mainly created for Unix (Linux/MacOS). Perhaps it could work on Windows.
All requisites should be available for your distribution. The most important are :
Check if docker-compose is already installed by entering the following command :
which docker-composeCheck Docker Compose compatibility :
- Clone or download the project
- Change directory to the specified directory (default to
yivic-dev-suite)
cd <path/to/project-directory>
# Init the .env file, then you can repair value needed to be updated, or you can copy `.env.example` -> `.env`
./scripts/init-env-file.sh
# Init dev suite, you can add first option for the namespace of dev suite to overwrite the one in .env file
./scripts/init-dev-suite.shchmod +x /scripts/init-dev-suite.sh if you can't execute it
For Mac user, it's better to create it inside your home, e.g <path/to/project-directory> = ~/workspace/yivic-dev-suite/
- Repair params on
docker-compose.ymlofetc/*.conforetc/*.inifiles to match your local - Run Docker Compose
docker-compose up -d- Wait for several mins and you'll have:
- Nginx (work as a webserver)
- PHP-FPM (PHP execution server)
- MySql
- phpmyadmin (should connect to mysql via host host.docker.internal)
- We include MySQL in docker containers but because we believe database is important and you may lose you db once docker failed. Using a database server on local machine is out proposal: use
host.docker.internal(for mac),10.0.2.2(for docker machine) for the hostname to connect to your main machine.
- Run the PHP composer container which your project folder on local machine bound to
/var/www/htmlof composer container
docker-compose run --rm -v /path/to/your/project/folder:/var/www/html php72_cli composer updatedocker-compose run --rm -v /path/to/your/project/folder:/var/www/html php72_cli wp plugin listdocker-compose run --rm -v /path/to/your/test/folder:/var/www/html php72_cli phpunitdocker-compose run --rm -v /path/to/your/test/folder:/var/www/html php72_cli codeceptSimilar thing if you want to use php_latest (use php_latest_cli instead)
ssdbis the instancephpssdbadminis the GUI manager of SSDB, http://:${PHPSSDBADMIN_WEB_EXPOSING_PORT}, user:admin, password:password
Any thought, feedback or issues, please put it here https://github.com/manhphuc/yivic-dev-suite/issues