Multiple WordPress sites with docker

Following Docker’s philosophy of “one application per container” you should have a database container for each WordPress instance. This way each database is isolated from the others. Should anything happen to one database it will not affect the others. Also, if you want to migrate or take down one website you only need to act upon its containers.

The official WordPress image is prepared to link to another container providing a database. Therefore you will have two containers per website: one for the WordPress files and another for the database. For the databases you might use the official MariaDB image.

The traffic for the several WordPress containers might then be distributed by a proxy container such as this one.

Leave a Comment