Based on docker setup, with on-demand debug capabilities.
Exposes two sites - w.test and d.w.test connected to same database. w.test is relatively fast site, while d.w.test has xdebug installed for tricky situations. They both are configured with same database and codebase, so all you have to is replace w.test with d.w.test in browser to switch into debug environment.
- Clone this repo.
cd woo_devand runsh install.sh.- Add following lines to
/etc/hosts:127.0.0.1 w.db 127.0.0.1 w.test 127.0.0.1 d.w.test
- Visit
https://w.test, accept security exception and complete the WordPress setup. - Visit
https://d.w.testand accept security exception. - (Optional) Debug server will connect on port 9001 with server name
Woo-Test, configure your IDE to listen to this port. - (Optional) Replace
host.docker.internalwith your local IP address in./docker-compose.ymlif you have configured Docker to run on a custom network. You should not need to do this on OSX.
sh install.shto install and start setup.sh start.shto start containers.sh stop.shto stop running containers.sh access_log.shto tail access logs along with request times.sh slow_query_log.shto tail slow DB queries. Currently this is setup to0.001s, you can configure this in./docker-compose.ymlby search-replacing--long_query_time=0.001param.clean-log.shto clean custom log files.docker-compose exec w.test bashto open a shell in main (faster) server.docker-compose exec d.w.test bashto open a shell in debug server.
Root directory woo_dev will contain:
-
WordPress- WordPress main install files. This is sourced control using Git to easy switch version.cdinto the directory to manage. This is mounted to/usr/src/public_html/wordpressinside docker containers. -
plugins- Plugin directory. This will havewoocommercedownloaded during the install step. Mounted to/usr/src/public_html/wp-content/pluginsinside docker containers. Note: For build files and dependencies, you can directly run commands likecomposer installornpm installfrom host aftercd'ing into directory. You can also open a shell inside docker to run these, but its not required. -
themes- Theme directory. This will be empty, so you would have to add a theme after fresh install. Mounted to/usr/src/public_html/wp-content/themesinside docker containers.
Mailcatcher is at 127.0.0.1:1080 from main server and 127.0.0.1:1081 from debug server. All sent mails to any address will end up here.