Skip to content

CemSites/php-dockerized

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

121 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Dockerized (Cemsites edition)

Dockerized PHP development stack: Nginx, MySQL, MongoDB, PHP-FPM, HHVM, Memcached, Redis, Elasticsearch and RabbitMQ

Build Status

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!

Additionally, for running local wordpress sites a couple of extra steps must be taken.

  1. Your site should relocated to php-dockerized/www/default within the vm. This can be accomplished with SCP or mounting a VM shared folder
  2. Inside the vm update your wp-config.php to point to the new database host at mysql (this is an alias to the mysql container us it like you would localhost)
  3. Inside the vm update your db username and password in wp-config.php for this installation use the following defaults
  • username: root
  • password: password
  1. On your host must update your hosts file by adding a line like this
<vm_ip> <domain_name from wp-config.php>
  1. To obtain the ip of the running VM you can either run
  • ifconfig within the vm

  • /Applications/VMware\ Fusion.app/Contents/Library/vmrun getGuestIPAddress from 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.

What's inside

Requirements

Running

Set up a Docker Machine and then run:

$ docker-compose build
$ docker-compose create
$ docker-compose start

From then on you can just run

docker-compose start

Or

$ docker-compose stop

Notes

The 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.

License

Copyright © 2014-2016 Kasper Kronborg Isager. Licensed under the terms of the MIT license.

About

Dockerized PHP development stack: Nginx, MySQL, MongoDB, PHP-FPM, HHVM, Memcached, Redis, Elasticsearch and RabbitMQ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Nginx 89.0%
  • Shell 10.3%
  • PHP 0.7%