User Documentation YAML structure

Sign up for Upsun

Get your free trial by clicking the link below.

Get your Upsun free trial

In addition to the basic functions you should be familiar with, YAML structure is important. accepts a certain structure for YAML configuration files.

When you run the platform project:init command, three default YAML configuration files are generated in the .platform folder and at the root of your source code. They contain the minimum default configuration based on your detected local stack. These YAML files are a good starting point before customization.

โ”œโ”€โ”€ .platform
|ย ย  โ”œโ”€โ”€ routes.yaml
|ย ย  โ””โ”€โ”€ services.yaml
โ””โ”€โ”€ <source code>

These three YAML files configure the following:

Examples Anchor to this heading

# Complete list of all available properties

# A unique name for the app. Must be lowercase alphanumeric characters.
# Changing the name destroys data associated with the app.
name: "app"

# The runtime the application uses.

# Complete list of available runtimes
type: "php:8.2"
# The services of the project.
# Each service listed will be deployed
# to power your project.
# Full list of available services

  # All available versions are: 10.6, 10.5, 10.4, 10.3
  type: mariadb:10.6
# The routes of the project.
# Each route describes how an incoming URL is going
# to be processed by
# More information

  type: upstream
  upstream: "app:http"

# A basic redirect definition
# More information

  type: redirect
  to: "https://{default}/"

In these files, you can use any of the available YAML tags you need.

Multi-app Anchor to this heading

In a multiple application context, you can also group all of your app configurations in a global .platform/applications.yaml file. This file contains a list of app configurations, such as:

  type: php:8.3
    root: app1

  type: nodejs:20
    root: app2

Is this page helpful?