Platform.sh User Documentation

Additional resources

Sign up for Upsun

Get your free trial by clicking the link below.

Get your Upsun free trial

Platform.sh supports multi-app configuration on projects - that is, including code for two separate sites that are deployed on their own containers within a single project cluster.

These days, an increasingly common pattern is to decouple content resources from a frontend Gatsby site. Decoupled sites use Gatsby’s source plugin ecosystem to pull external content resources into the build, where those resources (a headless CMS, for example) are typically located on a server elsewhere.

Platform.sh’s multi-app configuration gets around this, placing both frontend and backend sites on the same server by keeping the code for both sites in the same repository. Gatsby would reside in a subdirectory alongside another that contains the code for the backend resource. For example, a Gatsby site pulling content from a Drupal site could be kept in a single repository that looks like the snippet below:

.
โ”œโ”€โ”€ .platform
โ”‚ย ย  โ”œโ”€โ”€ routes.yaml
โ”‚ย ย  โ””โ”€โ”€ services.yaml
โ”œโ”€โ”€ drupal
โ”‚ย ย  โ”œโ”€โ”€ <application code>
โ”‚ย ย  โ””โ”€โ”€ .platform.app.yaml
โ”œโ”€โ”€ gatsby
โ”‚ย ย  โ”œโ”€โ”€ <application code>
โ”‚ย ย  โ””โ”€โ”€ .platform.app.yaml
โ”œโ”€โ”€ CHANGELOG.md
โ”œโ”€โ”€ LICENSE.md
โ””โ”€โ”€ README.md

This pattern can be replicated for a number of backend applications, and you can consult the Gatsby Headless guide for some common examples.

Is this page helpful?