wp-local-docker-v2
wp-local-docker-v2 copied to clipboard
Redis Option
It would be nice if there was a choice to install Memcached or Redis (plus its respectable plugin; related: #17). We use Redis on all of our projects.
This is what I'm running into now. Is there a workaround or a way to fork the memcache into a redis install? Thanks!
I did this already for myself, so I'll share.
This one right here has redis added in addition to memcache, so they are both running and usable wp-local-docker-v2 w/ redis
Run npm install and to note this won't be odviously able to be pulled from npm public packages, so what I did was simlink /path/to/wp-local-docker-v2/index.js -> /somewhere/in/path/10updocker and /path/to/wp-local-docker-v2/hosts.js -> /somewhere/in/path/10updocker-hosts
This is the base set of images they push to their dockerhub with redis added to PHP wp-local-docker-images w/ redis
This is the same images with redis added but also a build script in the root you can run to have them all built and tagged on your local system 10up/phpfpm:thetag so that when you use it your modified images will get used instead of pulling from their dockerhub wp-local-docker-images w/ redis & local build script
# To build them all locally
./build-phpfpm-local.sh
# Check if they built
docker images
You should see 10up/phpfpm:5.5 10up/phpfpm:5.6 10up/phpfpm:7.0 10up/phpfpm:7.1 10up/phpfpm:7.2 10up/phpfpm:7.3 10up/phpfpm:latest but 5.5 and 5.6 don't have redis, but who needs those anyways really, haha
This will work with Redis Cache
/** WP Config Constants */
define( 'WP_REDIS_CLIENT', 'pecl' );
define( 'WP_REDIS_HOST', 'redis' );
PS: If your interested in a pull request just let me know