Dockerized PHP development stack: Nginx, MySQL,
MongoDB, PHP-FPM, HHVM, Memcached,Redis,ElasticsearchandRabbitMQ
PHP Dockerized gives you everything you need for developing PHP applications locally. The idea came from the need of having an OS-agnostic and virtualized alternative to the great MNPP stack as regular LAMP stacks quite simply can't keep up with the Nginx + PHP-FPM/HHVM combo in terms of performance. I hope you'll find it as useful an addition to your dev-arsenal as I've found it!
- Your site should relocated to
php-dockerized/www/defaultwithin the vm. This can be accomplished with SCP or mounting a VM shared folder - Inside the vm update your
wp-config.phpto point to the new database host atmysql(this is an alias to the mysql container us it like you wouldlocalhost) - Inside the vm update your db username and password in
wp-config.phpfor this installation use the following defaults
- username:
root - password:
password
- On your host must update your hosts file by adding a line like this
<vm_ip> <domain_name from wp-config.php>- To obtain the ip of the running VM you can either run
-
ifconfigwithin the vm -
/Applications/VMware\ Fusion.app/Contents/Library/vmrun getGuestIPAddressfrom your host (getGuestIPAddress requires the running VMs vmx file as info so the full command is something like this)$ /Applications/VMware\ Fusion.app/Contents/Library/vmrun getGuestIPAddress ~/Documents/Virtual\ Machines.localized/site.vmwarevm/site.vmx
Once that setup is complete you can visit the normal domain name from your host and your site will load. To verify the hosts is configured correctly you can disable your wifi and the site will still load.
- Docker Engine
- Docker Compose
- Docker Machine (Mac and Windows only)
Set up a Docker Machine and then run:
$ docker-compose build
$ docker-compose create
$ docker-compose startFrom then on you can just run
docker-compose startOr
$ docker-compose stopThe vm doesn't seem to handle the combination of docker and suspend very well so just assume when you are not using this you are going to shut the vm down.
That's it! You can now access your configured sites via the IP address of the Docker Machine or locally if you're running a Linux flavour and using Docker natively.
Copyright © 2014-2016 Kasper Kronborg Isager. Licensed under the terms of the MIT license.