Which components it containing
Nginx, PHP7.2+XDebug, Elasticsearch, MySQL, Redis, Node
How to start
- You have to have docker and docker-compose on your local machine.
- Clone this project into your work directory.
- Make
docker-compose up --build -dfor build the containers. - Make
docker-compose up php-cli /bin/bashfor get into anyone container (just change some container name insteadphp-cli). - Enjoy your server
http://localhost:8080/you can change port fordocker-compose.yml, also you can make alias in your hosts file for another domain, put your make files into/publicdirectory.
How to use Xdebug for PhpStorm
- After building your containers go to File > Settings > Languages & Frameworks > PHP and chose your php-cli container as CLI Interpreter, if there is not it - create new interpreter and chose it from Docker machine.
- Change port Debug port for File > Settings > Languages & Frameworks > PHP > Debug to 9003
(you can change another port for
docker-compose.yml) - Go to File > Settings > Languages & Frameworks > PHP > Servers
and create new server call it as
dockerenter Host aslocalhost, choose checkboxUse path mappingsand enter root path/var/www. - That's all, take brake points and fpm and cli will be work with it
SSL and HTTPS
if You want to use https instead http you have to do a few simple steps.
- Change param
listen 80;aslisten 443 sslindocker/nginx/default.conf. - Add a few parameters into server{} body of file
docker/nginx/default.conf:ssl off; ssl_certificate /etc/nginx/ssl/ssl-cert-snakeoil.pem; ssl_certificate_key /etc/nginx/ssl/ssl-cert-snakeoil.key; - Change port in
docker-compose.ymlwhere nginx section from 80 to 443.