> ## Documentation Index
> Fetch the complete documentation index at: https://docs.webapp.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Multiple build steps: The Layerfile graph

> Layerfiles can be composed, inherited from, and split into complex CI workflows.

Consider these three Layerfiles:

##### 1. Layerfile at (repo root)/Layerfile

```docker Layerfile theme={null}
FROM vm/ubuntu:18.04
RUN apt-get update && apt-get install postgresql python3
```

##### 2. Layerfile at (repo root)/web/tests/Layerfile

```docker Layerfile theme={null}
FROM /Layerfile
COPY /web .
RUN ./unittest.sh
```

##### 3. Layerfile at (repo root)/web/Layerfile

```docker Layerfile theme={null}
FROM /Layerfile
COPY /web .
RUN BACKGROUND ./start-webserver.sh
EXPOSE WEBSITE localhost:8080
```

When built, these three Layerfiles will automatically combine into a build
graph:

<img src="https://mintcdn.com/webappio/s6-eR6DYSUsnelQ0/resources/advanced-workflows-intro-graph.svg?fit=max&auto=format&n=s6-eR6DYSUsnelQ0&q=85&s=a7e5e0f1efc18f18a0fa946d137645b3" alt="Advanced workflow graph example" width="291" height="118" data-path="resources/advanced-workflows-intro-graph.svg" />

Here, webapp.io has searched for files named 'Layerfile', discovered all three
of these files, and linked them based on their parents (by their FROM lines)

There are many directives which can change the Layerfile graph, see `SPLIT`,
`BUTTON`, and `WAIT` below for some examples.
