Creating 2 wordpress container with 1 database

Yes, of course. You just need to choose different WORDPRESS_DB_NAME for both wordpress services, but then you need to precreate those before you start the wordpresse. Check the image description and you will find WORDPRESS_TABLE_PREFIX which can be changed and you can have multiple wordpresses in the same database.

https://hub.docker.com/_/wordpress

2 Likes