DEV Community

Discussion on: The beauty of Docker for local Laravel development

Collapse
 
tkoop profile image
Tim Koop

I think I've got this set up, but it's slow on my Windows machine. When using WSL 2, Microsoft recommends you "store your files in the WSL file system", whatever that means, for performance reasons. I've played around with the volumes in docker-compose.yml, but I can't get it working. How would I do this? Thanks!
docs.microsoft.com/en-us/windows/w...

Collapse
 
aschmelyun profile image
Andrew Schmelyun

Hey Tim!

So essentially when it says "Store your files in the WSL file system" it means in the Linux partition that Windows creates when using WSL.

If you open up a Windows Terminal session in Bash, by default it should put you in a directory called like /mnt/c/Windows. Run cd ~ to get to the home directory in the WSL file system, and then from there you can use any directory under that one to create your Docker-ized application and it will run way faster.

For instance, I have mine at ~/Sites/example.com. Let me know if that helps!

Collapse
 
tkoop profile image
Tim Koop • Edited

So in your docker-compose.yml file, what do your volumes look like? I changed mine from
volumes:
- .src:/var/www/html
to
volumes:
- ~/site:/var/www/html
And now I get a 404 error, even thought there is an index.html file there.

Thread Thread
 
tkoop profile image
Tim Koop

To answer my own question, the answer is to run docker-compose inside wsl, not from the Windows prompt.