So we are trying to move away from the LAMP stack and embrace Docker for local development. Of which Laravel had Sail as an answer
But upon investigating the docs, it seems to me that Sail works by having the source code installed in the Wsl2 itself (most of us use windows)
Is this mandatory? Do everyone on the teams must clone the repo directly on wsl2? Can I just put it in Windows and mount the folder in the container? (Most of our company computers is set up to have a folders to manage source code of all projects)
Or is it just better to just do it manually? If so, do you prefer using Docker for outside services (db, redis,...) and running the actual codebase on host machine, or do you prefer it to be all serve through a container?
Sail does not require the source code to be installed in WSL2. It is possible to mount the source code folder from the host machine into the container. This can be done by specifying the path to the source code folder in the docker-compose.yml file. Here is an example:
In this example, the volumes section specifies that the current directory (./) on the host machine should be mounted to the /var/www/html directory in the container.
As for whether to run the codebase in a container or on the host machine, it depends on the specific requirements of the project. Running everything in a container can make it easier to manage dependencies and ensure consistency across different environments. However, running the codebase on the host machine can provide better performance. It is recommended to experiment with both approaches and see which one works best for your project.
@frankielee i do know that there is performance drawbacks, but we had a dozen apps on our dozens computer all sorted on the window filesystem. I dont want to introduce more complexity in the codebase management by "some of the projects in windows, some in the wsl2".
@frankielee that seem like a pretty big performance hit. One more question though, what is your workflow? do your team just clone the repo straight into wsl2 and work in there exclusively?
As someone with 2 many older systems lying around. You want 16GB mem min on any system you do attempt it with for sanity. Once up it is very nice to work with and you can tweak the env for different versions of this that and the other with with quick docker down & docker build & docker up. be it php version or db mysql vs mariadb redis versions. very flexible.
@veinhugain how are you and your team set up Sail? do everyone just clone the repo straight into wsl2 and work in there exclusively, or do you mount to docker from windows filesystem?