It is now recommended to use Sail & Docker with Laravel 8
Now I use homestead, but I wanted to upgrade my system to the latest version 8 and I did the setup before I installed the Docker Desktop and Sail http: // localhost everything works, however nodejs npm and mysql redis are ready for everything
The topic I want to learn is sail & docker, how does multiple projects work in this structure?
For example Homestead before working on this config
- map: homestead.test
to: /home/vagrant/project1/public
- map: another.test
to: /home/vagrant/project2/public
Thanks
2
Answers
You need to change the ports (MySQL, Redis, MailHog etc.) if you want to run multiple projects at the same time.
Application, MySQL, and Redis Ports
Add the desired ports to the
.env
file:MailHog Ports
Update MailHog ports in the
docker-compose.yml
file. Change these lines:to this:
Once the containers have been started, you can access your application at
http://localhost:81
and the MailHog web interface athttp://localhost:8026
.Yes. You have to change to all non-conflict ports for all Laravel Sail project.
If you want to use custom domain like what you did in Homestead,
you can use the Nginx Proxy to achieve Multiple Project just like Homestead
Here is my article: step-by-step tutorial you can follow with….