Platform.sh is now Upsun. Click here to learn more
Upsun Fixed User Documentation

Single-runtime image

Try Upsun for 15 days
After that, enjoy the same game-changing Upsun features for less with the First Project Incentive!¹ A monthly $19 perk!
Activate your 15-day trial
¹Terms and conditions apply. Only for Flexible Resource projects.

See all of the options for controlling your apps and how they’re built and deployed on Upsun Fixed.

For single-app projects, use the .platform.app.yaml file, which is typically located at the root of your Git repository, to configure the apps in your single-runtime image.

See a comprehensive example of a configuration in a .platform.app.yaml file.

Multi-app projects can be set up in various ways.

For reference, see a log of changes to app configuration.

Top-level properties Anchor to this heading

The following table lists all properties available at the top level of the YAML for the app.

The Set in instance column defines whether the given property can be overridden within a web or workers instance. To override any part of a property, you have to provide the entire property.

Name Type Required Set in instance? Description
name string Yes No A unique name for the app. Must be lowercase alphanumeric characters. Changing the name destroys data associated with the app.
type A type Yes No The base image to use with a specific app language. Format: runtime:version.
size A size Yes Amount of resources to allocate to the app; defaults to AUTO in production environments. Examples: S, M,4XL.
relationships A dictionary of relationships Yes Connections to other services and apps.
disk integer or null Yes The size of the disk space for the app in MB. Minimum value is 128. Defaults to null, meaning no disk is available. See the disk property details.
mounts A dictionary of mounts Yes Directories that are writable even after the app is built. If set as a local source, disk is required.
web A web instance N/A How the web application is served.
workers A worker instance N/A Alternate copies of the application to run as background processes.
timezone string No The timezone for crons to run. Format: a TZ database name. Defaults to UTC, which is the timezone used for all logs no matter the value here. See also app runtime timezones
access An access dictionary Yes Access control for roles accessing app environments.
variables A variables dictionary Yes Variables to control the environment.
firewall A [firewall dictionary Yes Outbound firewall rules for the application.
build A build dictionary No What happens when the app is built.
dependencies A dependencies dictionary No What global dependencies to install before the build hook is run.
hooks A hooks dictionary No Specifies commands and/or scripts to run in the build, deploy, and post_deploy phases.
crons A cron dictionary No Scheduled tasks for the app.
source A source dictionary No Information on the app’s source code and operations that can be run on it.
runtime A runtime dictionary No Customizations to your PHP runtime.
additional_hosts An additional hosts dictionary Yes Maps of hostnames to IP addresses.
operations A dictionary of Runtime operations No Runtime operations for the application.

Root directory Anchor to this heading

Some of the properties you can define are relative to your app’s root directory. The root defaults to the location of your .platform.app.yaml file.

That is, if a custom value for source.root is not provided in your configuration, the default behavior is equivalent to the above.

To specify another directory, for example for a multi-app project, use the source.root property.

type Anchor to this heading

The type defines the base container image used to run the application. The version is the major (X) and sometimes minor (X.Y) version numbers, depending on the service, as in the following table. Security and other patches are taken care of for you automatically.

Available languages and their supported versions:

Language runtime Supported version
C#/.Net Core dotnet 7.0, 6.0, 8.0
Elixir elixir 1.18, 1.15, 1.14
Go golang 1.25, 1.24, 1.23, 1.22, 1.21, 1.20
Java java 21, 19, 18, 17, 11, 8
JavaScript/Node.js nodejs 24, 22, 20
PHP php 8.5, 8.4, 8.3, 8.2, 8.1
Python python 3.13, 3.12, 3.11, 3.10, 3.9, 3.8
Ruby ruby 3.4, 3.3, 3.2, 3.1, 3.0
Rust rust 1

Example configuration Anchor to this heading

These are used in the format runtime:version:

.platform.app.yaml
type: 'php:8.5'

build Anchor to this heading

The only property of the build dictionary is flavor, which specifies a default set of build tasks to run. Flavors are language-specific.

See what the build flavor is for your language:

In all languages, you can also specify a flavor of none to take no action at all (which is the default for any language other than PHP and Node.js).

.platform.app.yaml
build:
  flavor: none

dependencies Anchor to this heading

Installs global dependencies as part of the build process. They’re independent of your app’s dependencies and are available in the PATH during the build process and in the runtime environment. They’re installed before the build hook runs using a package manager for the language.

Language Key name Package manager
PHP php Composer
Python 2 python or python2 Pip 2
Python 3 python3 Pip 3
Ruby ruby Bundler
Node.js nodejs npm (see how to use yarn)

The format for package names and version constraints are defined by the specific package manager.

An example of dependencies in multiple languages:

.platform.app.yaml
applications:
  APP_NAME:
    type: 'nodejs:24'
    source:
      root: "/"
    dependencies:
      php: # Specify one Composer package per line.
        drush/drush: '8.0.0'
        composer/composer: '^2'
      python2: # Specify one Python 2 package per line.
        behave: '*'
        requests: '*'
      python3: # Specify one Python 3 package per line.
        numpy: '*'
      ruby: # Specify one Bundler package per line.
        sass: '3.4.7'
      nodejs: # Specify one NPM package per line.
        pm2: '^4.5.0'

runtime Anchor to this heading

The following table presents the various possible modifications to your PHP runtime:

Name Type Language Description
extensions List of strings OR extensions definitions PHP PHP extensions to enable.
disabled_extensions List of strings PHP PHP extensions to disable.
request_terminate_timeout integer PHP The timeout (in seconds) for serving a single request after which the PHP-FPM worker process is killed.
sizing_hints A sizing hints definition PHP The assumptions for setting the number of workers in your PHP-FPM runtime.
xdebug An Xdebug definition PHP The setting to turn on Xdebug.

You can also set your app’s runtime timezone.

Extensions Anchor to this heading

You can enable PHP extensions just with a list of extensions:

.platform.app.yaml
applications:
  APP_NAME:
    type: 'php:8.5'
    source:
      root: "/"
    runtime:
      extensions:
        - geoip
        - tidy

Alternatively, if you need to include configuration options, use a dictionary for that extension:

.platform.app.yaml
applications:
  APP_NAME:
    type: 'php:8.5'
    source:
      root: "/"
    runtime:
      extensions:
        - geoip
        - name: blackfire
          configuration:
            server_id: foo
            server_token: bar

In this case, the name property is required.

Sizing hints Anchor to this heading

The following table shows the properties that can be set in sizing_hints:

Name Type Default Minimum Description
request_memory integer 45 10 The average memory consumed per request in MB.
reserved_memory integer 70 70 The amount of memory reserved in MB.

See more about PHP-FPM workers and sizing.

Combine single-runtime and composable images Anchor to this heading

In a multiple application context, you can use a mix of single-runtime images and composable images.

The following sample configuration includes two applications:

  • frontend – uses a single-runtime image
  • backend – uses a composable image
    In this app, PHP is the primary runtime and is started automatically (PHP-FPM also starts automatically when PHP is the primary runtime). For details, see the PHP as a primary runtime section in the Composable image topic.
.platform.app.yaml
applications:
  frontend:
    # this app uses the single-runtime image with a specific node.js runtime
    type: 'nodejs:24'
  backend:
    # this app uses the composable image and specifies two runtimes
    type: "composable:8.4"
    stack:
      runtimes:
        - "php@8.4":
            extensions:
              - apcu
              - sodium
              - xsl
              - pdo_sqlite
        - "python@3.13"
      packages:
        - "python313Packages.yq" # python package specific