Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
That’s a nice tutorial with some valuable hints, but contrary to it’s title it doesn’t explain how to run multiple WP applications.
I run several apps and map different domains to them. ATM I don’t use docker but keep them in different directories and have Nginx configured with multiple server clauses. I also use single MySQL instance for all of them.
Now I’d like to move to Docker with each app in it’s own container. If I understand correctly each container would have it’s own MySQL instance. Is this efficient? Or should I run separate container with MySQL and have it available in my WP containers?
Also how would you address domain - apps mapping? Should I use Nginx as a reverse proxy or is there a better way?
Anyway thanks for your article.
Thanks for the tutorial. but when I read it I got the same questions in my mind as @tadeusz ask.
And, I need to run and manage 3 wordpress websites under its own 3 separate domains. So, which plan do I need to choose? I need to use email services too for each domain.
Thanks
You need to set up nginx or Apache in front of everything as a reverse proxy. For instance, say you have two Wordpress dockers running. Set them to be available over localhost at two different ports:
<pre> docker run -p 127.0.0.1:8081:80 tutum/wordpress1 docker run -p 127.0.0.1:8082:80 tutum/wordpress2 </pre>
If you were using nginx, you’d then do something like:
<pre> server { listen 80;
server_name app1.domain.com;
location / {
proxy_pass http://localhost:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
server { listen 80;
server_name app2.domain.com;
location / {
proxy_pass http://localhost:8082;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
} </pre>
How to properly address the storage persistency issue? By default Docker containers are ephemeral.
@shafqat: One solution people are using for that is data container volumes. Check out: http://docs.docker.io.s3-website-us-west-2.amazonaws.com/use/working_with_volumes/
There is something that I still don’t get with docker and this tutorial
If I stop the container, commit the image and run the resulting image all my configurations are gone. Is this the expected behavior? If yes? How should I configure it to be persistent?
If I “docker run -i -t tutum/wordpress /bin/bash” and create some files, then I stop, commit and run the resulting image then the files are still there. I don’t get the difference between the two scenarios.
(Note: I had to change from aufs to devicemapper otherwise I got an error starting mysql, is this the problem?)
There’s a simple Curl script to automate the first step on Ubuntu 14.04:
I agree w/ other feedback. The title for this tutorial is completely misleading. Also I don’t think you’d necessarily want to setup multiple docker wordpress containers either. Wordpress has multi-site capabilities already built in. Seems like this article should be showing this setup in addition to what it’s already shown.
Thanks for the great tutorial. Btw, check out http://docker4wordpress.org, it’s a set of pre-configured containers you can use to spin up your local environment for wordpress development