Sharing project configurations
When working in a team, it’s important to ensure that everyone uses the same PHP version, certificate settings, and service versions. You can use theherd.yml file to manage these configurations within your repository.
Creating the herd.yml file
The easiest way to create the herd.yml file is by running the herd init command in your project directory.
herd.yml file. If you run herd init in a project that already has this file, it configures your site accordingly. Re-running the command after a change, applies all additional configurations but does not remove existing ones.
The setup allows you to configure the following settings:
- Project Name
- Aliases (aka multiple domains)
- PHP Version
- TLS/SSL Certificates
herd.yml and to install them automatically. By default, Herd preselects the services that are present in your .env file, but you can add more if needed.
The list contains the latest versions of these services and if you need other versions, check the section about editing the herd.yml file.
herd.yml file will be created in your project root. To overwrite an existing file, you can use the herd init --fresh command and generate a new file.
Setting up a project via herd.yml
If a herd.yml file exists in your project, Herd can automatically apply the necessary configuration via the herd init command.
herd init checks for the presence of an .env file and if not, asks if the .env.example file should be copied. After that, this command applies the configurations, including installing and isolating the specific PHP version, aliases, services and more:
Editing the herd.yml file
Here is an example of a herd.yml file using all possible customizations:
.env file with the placeholder (e.g. ${REDIS_PORT}) you can set a fixed port as well - just keep in mind that your team members may use these ports already.
You can check out a list of available services and versions here.