How to create symlink to /web/wp/?

Hi all,

New to bedrock and wondering how it might be possible to re-use /web/wp/ across multiple website instances.

My folder structure looks something like this (edited for clarity):

/sites/site1/web/wp/
/sites/site2/web/wp/
etc.

and I have created the following folders of the last few WP releases:

/sites/wp/5.9/
/sites/wp/5.8/
etc.

My goal was to create the following symlink:

/sites/site1/web/wp/ >> /sites/wp/5.9/

However, as soon as I create the symlink, Wordpress is unable to see the files, and wants to generate a new wp-config.php:

There doesn't seem to be a wp-config.php file. I need this before we can get started.
Need more help? We got it.
You can create a wp-config.php file through a web interface, but this doesn't work for all server setups. The safest way is to manually create the file.

Has anyone figured out how to make something like this before?

edit:

I also just tried to same type of setup with a mount:

mount -o bind ../../wp/5.9 /sites/site1/web/wp

still no luck.

edit 2:

I failed to mention that I am running this setup within docker.
the mount command actually DOES work, I just needed to restart the container for it to see the mount ed folder.

Now, is there a better way to do this still?

Why do you want to do this? You’ve explained what you want to do, but not why, which is often more important. Why not use Multisite?

I’m just looking for ways to be more efficient, more secure. Sites all belong to different clients and will need independent dev/staging environments, so I don’t see multisite as an option.

I’m not certain how this would be more secure or necessarily more efficient. Sharing resources, even locally, between separate client sites seems like it would always be less secure because of the possibility of cross-contamination. You’d also be doing something (sharing resources in this way) that is pretty non-standard, which would mean you’d likely end up spending a non-trivial amount of time trying to debug issues that you would struggle to find help with. WordPress core (including default themes) is only around 60MB, which doesn’t seem like enough to really warrant trying to de-duplicate it. This approach would also make it more difficult for you to have single, all-inclusive repos per project: At my previous agency each client would have a single repo containing Trellis, Bedrock, and their Sage-based theme, which made it much easier to spin up a single project when needed.

thanks for the feedback. For what it’s worth, my plan was to lock down the /wp/ release folders with a different set of user/group permssions. But… I’ll take your advice and keep it simple.