Laravel Sail with Multiple Docker Compose Config Files

Laravel Sail with Multiple Docker Compose Config Files

We often find ourselves in a situation where two groups are collaborating on the same Laravel project – one for the Backend and another for the Frontend.

The Backend group requires the MySQL service, so they use docker-compose.yml with the MySQL service properly configured.

On the other hand, the Frontend group utilizes an external MySQL service like Planetscale, and therefore, they need docker-compose.local.yml with the MySQL service removed.

To instruct Sail to load docker-compose.local.yml for the Frontend group, follow these steps:

  1. Edit your .env file.
  2. Set SAIL_FILES to docker-compose.local.yml.

By taking these steps, you not only save considerable local storage on your computer but also save time by skipping the loading of the MySQL service for the Frontend group.

Comments

Popular Posts