2

I want to host multiple independent wordpress sites (4-10) on a rootserver. I want to host them using docker containers. Now the Q: Is it better to run ONE mysqldb running all wordpress schemes for the multiple sites, or is ist better to run one mysql instance per wordpress. Thank you. N.

  • Depends on the size of your DB and if each site is a multisite with more sites. If they all need to access the same data then sharing a database would be nice. But for perf, go with separate DBs. – jgraup Nov 17 '16 at 4:14
2

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.

| improve this answer | |
0

I saw something that may help you. Click here to see : http://donalfarrell.com/2015/08/11/Docker-Nginx-Multi-Wordpress.html

Basically you need to use reverse proxy to resolve this problem and you can use the 'link' property do sync your web application with specific database container. Nginx container to do reverse proxy, may be a good solution for you.

I hope it helps =)

| improve this answer | |
0

If you don't have resource problem then create a docker-compose file per WordPress with a MySQL container per WordPress. Apps will be isolated, if not you can have some problems if you use one MySQL db container for all sites

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.