Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend
Build a copy of this image:
git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
Launch an instance of wordpress:fpm
just as you'd launch wordpress
:
docker run -d --link some-mysql:mysql --name wordpress-fpm wordpress:fpm
Launch an instance of this image to front wordpress:fpm
and serve static assets:
docker run -d --link wordpress-fpm:fpm --volumes-from wordpress-fpm -p 80:80 nginx-fpm
Thanks for this gist, it helped me a lot.
BTW, it's also possible to simply start a container with a custom config file for nginx without building an image from Dockerfile:
docker run -d -v /some/wordpress-fpm.conf:/etc/nginx/conf.d/default.conf:ro --link wordpress-fpm:fpm --volumes-from wordpress-fpm -p 80:80 nginx