How do I configure volumes and network in Docker compose on Windows for locally running WP + WP-CLI in a separate container

[ad_1]

I am running a WP container and a WP-CLI container, both configured in the same compose file. At the moment I have volumes configured like this:

# both WP and WP-CLI containers
./wp/root:/var/www/html

# WP container only
./wp/wp-content/mu-plugins:/var/www/html/wp-content/mu-plugins
./wp/wp-content/themes/my_theme:/var/www/html/wp-content/themes/my_theme

First volume definition allows me to use WP-CLI in a separate container (it needs access to WordPress files inside WP container), the other two allow me to persist my code on the host.

Does mounting the first volume like that degrade performance? Is there a better way to configure the stack so that I can both use the WP-CLI in a separate container and persist my code on the host in the project dir?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer