cytopia / devilbox

A modern Docker LAMP stack and MEAN stack for local development
http://devilbox.org
MIT License
4.4k stars 654 forks source link

[Howto]: Symlink or mount alternate project directories, Docker Desktop for Windows (wsl2) #1030

Closed metal450 closed 2 months ago

metal450 commented 2 months ago

Have you already checked elsewhere?

What are you struggling with?

I've got Devilbox up & running, on Docker Desktop for Windows (wsl2). Now I'd like to move my projects from data/www to elsewhere:

Seems similar to https://devilbox.discourse.group/t/weird-symlink-behavior/79/3, but I couldn't find a solution there either. Help would be much appreciated.

What have you tried already?

Described above

What is your goal?

Described above

metal450 commented 2 months ago

Addendum: I just noticed something else. When I start the container, it's actually creating www/site1/htdocs, which is empty. If I delete that empty site1 folder it created, then vhosts.php actually doesn't show the host at all - so the "OK" there was maybe just looking at that empty directory, rather than my mapped volume. Once that's deleted, if I access https://site1.test in the browser, it actually routes me to the main devilbox dashboard - ie equivalent to http://localhost.

I thought I was really close to the solution...but actually now I'm at even more of a loss.

metal450 commented 2 months ago

Got it! The issue was that I had to map the same paths, i.e. - ../../../../site1/htdocs:/shared/httpd/site1/htdocs, to both the httpd and php containers. Then it worked.