Introduction

On a high level your lando configuration should contain ALL the things you need to run, develop and test your project. The ideal we strive for is best expressed as:

A user should be able to git clone a repository, run lando start and get EVERYTHING they need to develop their site locally in a few minutes.

Implicit in the above is that your lando configuration should always be checked into version control at the root directory of your project.

We've found a useful pattern here is for the senior-est, most DevOps-y person on your team to craft the initial lando configuration and be responsible for its maintanence but to generally "set it and forget it".

Ok cool, I dig it. What do I need to get started?

In order for you to get started using the awesome power of Lando you need to have

If you are unclear on how to manually set this up check out our lando init command which can help you initialize code from various sources for use with Lando.

So, what does this Landofile look like anyway?

As mentioned above, the Landofile is generally called .lando.yml but is both configurable and overridable. It needs a name but beyond that it can contain any combination of the following things although generally it only uses a small subset of these.

Note that the values in each key above are not particularly relevant to what we are discussing which is the purpose of each. To that end here is some information about each and links to their docs if applicable

name - Nothing special here. This should be a unique way for you to identify your app.

compose - This is a list of docker-compose files you can tell Lando to start. The paths are relative to the root of your project. Generally this option is not used in favor of Lando recipes and/or services but is an option that makes sense under some circumstances.

Note that services located in these files will still get injected with Lando's default environment variables and also be networked like any other Lando service but will not get any of the extra Lando secret sauce.

If you are interested in using something Lando does not currently offer we recommend looking at the custom compose service.

env_file - A list of environment files relative to your project's root directory. Each file should contain a list of KEY=VALUE pairs that will then get injected into the environment of every service.

events - Events allow the user to run arbitrary commands, or combinations of commands, on arbitrary services, or combinations of service after or before certain parts of the Lando runtime. A good example is clearing out an applications cache after a database is imported.

recipe - Recipes are combinations of services, proxies, and tooling designed as a start-state-of-sane-defaults for a particular use case eg drupal7.

config - Config allows you to set some of the more important things your recipe provides. These settings are usually different depending on the recipe you select.

proxy - Proxy settings allow users to map arbitrary domain names to arbitrary ports inside of arbitrary services. Think: I go to the browser and type in myapp.lndo.site or millard.filmore.for.lyfe and it loads my application.

services - Services are simplified but still highly configurable Docker containers. They are able to run build steps such as installing a php-extension or running yarn install and can also be overridden down to the docker-compose level. They also get some automatic networking and security features.

tooling - Tooling allows users to run arbitrary commands, or combinations of commands, on arbitrary services, or combinations of services when invoked.

This is helpful so you can run lando yarn install instead of docker exec -it SERVICE yarn install or so lando test can run composer test and yarn test in their respective services. You can also specify options, including interactive ones, to build out more complicated commands like lando pull-my-database-from-aws --user=me --password=*** or to have a single command run on many services eg lando db-import dump.sql -h database2.

A LATE TL;DR - We HIGHLY recommend you read through the linked documentation above to get a sense of the things the Landofile can do for you and/or your team.

How do I make one?

There are various ways to craft your Landofile but we've found and observed the following strategy to be generally a good approach.

Shop around for a recipe that can serve as a good starting point. lando init is helpful for this.