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

# Single-runtime image

> See all of the options for controlling your apps and how they're built and deployed on Upsun Cloud.

Use the `.upsun/config.yaml` file,
located at the root of your Git repository, to configure the apps in a single-runtime image.

See a [comprehensive example](https://developer.upsun.com/docs/configure-apps#comprehensive-example) of a configuration in
a `.upsun/config.yaml` file.

[Multi-app projects](https://developer.upsun.com/docs/configure-apps/multi-app) can be set up in various ways.

## Primary application properties

In the `.upsun/config.yaml` file, configure each application as a unique key beneath the top-level `applications` key.

For example, if your deployed site requires a Javascript `frontend` application container and a Python `backend` application container, the `.upsun/config.yaml` file would start to look something like this:


&#x20;   applications:
&#x20;     frontend:
&#x20;       type: 'nodejs:\{\{version:nodejs:latest}}'
&#x20;       \# Additional frontend configuration
&#x20;     backend:
&#x20;       type: 'python:\{\{version:python:latest}}'
&#x20;       \# Additional backend configuration

The following table presents all of the properties available to each unique app beneath the `applications` key.

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.

> [!NOTE]
>
> The `build`, `dependencies`, and `runtime` properties are unique to this image type and are described later in this topic. All other properties are available in both single-runtime and composable images — click a property name to view its details in a separate topic.

| Name | Type | Required | Set in instance? | Description |
| - | - | - | - | - |
| [`type`](#type) | A type | Yes | No | The base image to use with a specific app language. Format: `runtime:version`. |
| [`container_profile`](https://developer.upsun.com/docs/configure-apps/image-properties/container_profile) | A container profile | | Yes | Determines which combinations of CPU and RAM a container can use. |
| [`relationships`](https://developer.upsun.com/docs/configure-apps/image-properties/relationships) | A dictionary of relationships | | Yes | Connections to other services and apps. |
| [`mounts`](https://developer.upsun.com/docs/configure-apps/image-properties/mounts) | A dictionary of mounts | | Yes | Directories that are writable even after the app is built. Allocated disk for mounts is defined with a separate resource configuration call using `upsun resources:set`. |
| [`web`](https://developer.upsun.com/docs/configure-apps/image-properties/web) | A web instance | | N/A | How the web application is served. |
| [`workers`](https://developer.upsun.com/docs/configure-apps/image-properties/workers) | A worker instance | | N/A | Alternate copies of the application to run as background processes. |
| [`timezone`](https://developer.upsun.com/docs/configure-apps/timezone) | `string` | | No | The timezone for crons to run. Format: a [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Defaults to `UTC`, which is the timezone used for all logs no matter the value here. See also [app runtime timezones](https://developer.upsun.com/docs/projects/change-project-timezone.md) |
| [`access`](https://developer.upsun.com/docs/configure-apps/image-properties/access) | An access dictionary | | Yes | Access control for roles accessing app environments. |
| [`variables`](https://developer.upsun.com/docs/configure-apps/image-properties/variables) | A variables dictionary | | Yes | Variables to control the environment. |
| [`build`](#build) | A build dictionary | | No | What happens when the app is built. |
| [`dependencies`](#dependencies) | A dependencies dictionary | | No | What global dependencies to install before the `build` hook runs. |
| [`hooks`](https://developer.upsun.com/docs/configure-apps/image-properties/hooks) | A hooks dictionary | | No | What commands run at different stages in the `build`, `deploy`, and `post_deploy` phases. |
| [`crons`](https://developer.upsun.com/docs/configure-apps/image-properties/crons) | A cron dictionary | | No | Scheduled tasks for the app. |
| [`source`](https://developer.upsun.com/docs/configure-apps/image-properties/source) | A source dictionary | | No | Details about the app’s source code and available operations. |
| [`runtime`](#runtime) | A runtime dictionary | | No | Customizations to your PHP runtime. |
| [`additional_hosts`](https://developer.upsun.com/docs/configure-apps/image-properties/additional_hosts) | An additional hosts dictionary | | Yes | Mappings of hostnames to IP addresses. |
| [`authorizations`](https://developer.upsun.com/docs/configure-apps/image-properties/authorizations) | | An authorizations dictionary | Yes | An authorizations list that grants applications and tasks narrowly-scoped access to the environment API and task operations. |
| [`operations`](https://developer.upsun.com/docs/configure-apps/runtime-operations) | A dictionary of runtime operations | | No | Runtime operations for the application. |

## Root directory

Some of the properties you can define are relative to your app's root directory.
The root defaults to the root of the repository.


&#x20;   applications:
&#x20;     frontend:
&#x20;       type: 'nodejs:\{\{version:nodejs:latest}}'
&#x20;       \# Default behavior of source.root
&#x20;       source:
&#x20;         root: "/"

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](https://developer.upsun.com/docs/configure-apps/multi-app),
use the [`source.root` property](https://developer.upsun.com/docs/configure-apps/image-properties/source).

## `type`

> [!NOTE]
>
> To install *multiple* runtimes and tools in your application container, use the Upsun Cloud composable image.\\
>
> If you arrived here from another page, you may want to review the supported `stack` key where `type` was referenced.\\
>
> For details, see the list of [supported Nix runtimes](https://developer.upsun.com/docs/configure-apps/app-reference/composable-image.md#upsun-supported-nix-runtimes) that you can define in a composable image `stack`.

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 | Type key | Supported versions |
| - | - | - |
| [C#/.Net Core](https://developer.upsun.com/docs/languages/dotnet.md) | `dotnet` | 10.0 8.0 |
| [Elixir](https://developer.upsun.com/docs/languages/elixir.md) | `elixir` | 1.20 1.19 1.18 |
| [FrankenPHP](https://developer.upsun.com/docs/languages/php/frankenphp.md) | `frankenphp` | 1.8.5 1.8.4 1.8.3 1.8.2 |
| [Go](https://developer.upsun.com/docs/languages/go.md) | `golang` | 1.27 1.26 |
| [Java](https://developer.upsun.com/docs/languages/java) | `java` | 25 21 |
| [JavaScript/Node.js](https://developer.upsun.com/docs/languages/nodejs) | `nodejs` | 26 24 22 |
| [PHP](https://developer.upsun.com/docs/languages/php) | `php` | 8.5 8.4 8.3 8.2 |
| [Python](https://developer.upsun.com/docs/languages/python) | `python` | 3.14 3.13 3.12 3.11 |
| [Ruby](https://developer.upsun.com/docs/languages/ruby.md) | `ruby` | 4.0 3.4 3.3 |
| [Rust](https://developer.upsun.com/docs/languages/rust.md) | `rust` | 1 |

### Example configuration

These are used in the format `runtime:version`:


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       type: 'php:\{\{version:php:latest}}'

## `build`

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:

* [Node.js](https://developer.upsun.com/docs/languages/nodejs#dependencies)
* [PHP](https://developer.upsun.com/docs/languages/php#dependencies)

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).


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       source:
&#x20;         root: "/"
&#x20;       type: 'nodejs:\{\{version:nodejs:latest}}'
&#x20;       build:
&#x20;         flavor: none

## `dependencies`

Installs global dependencies as part of the build process.
They're independent of the code dependencies of your application
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](https://getcomposer.org/) |
| Python 2 | `python` or `python2` | [Pip 2](https://packaging.python.org/tutorials/installing-packages/) |
| Python 3 | `python3` | [Pip 3](https://packaging.python.org/tutorials/installing-packages/) |
| Ruby | `ruby` | [Bundler](https://bundler.io/) |
| Node.js | `nodejs` | [npm](https://www.npmjs.com/) (see [how to use yarn](https://developer.upsun.com/docs/languages/nodejs#use-yarn-as-a-package-manager)) |

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

An example of dependencies in multiple languages:


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       type: 'nodejs:\{\{version:nodejs:latest}}'
&#x20;       source:
&#x20;         root: "/"
&#x20;       dependencies:
&#x20;         php: # Specify one Composer package per line.
&#x20;           drush/drush: '8.0.0'
&#x20;         python2: # Specify one Python 2 package per line.
&#x20;           behave: '\*'
&#x20;           requests: '\*'
&#x20;         python3: # Specify one Python 3 package per line.
&#x20;           numpy: '\*'
&#x20;         ruby: # Specify one Bundler package per line.
&#x20;           sass: '3.4.7'
&#x20;         nodejs: # Specify one NPM package per line.
&#x20;           pm2: '^4.5.0'

## `runtime`

This applies to PHP only.

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

| Name | Type | Language | Description |
| - | - | - | - |
| `extensions` | List of `string`s OR [extensions definitions](#extensions) | PHP | [PHP extensions](https://developer.upsun.com/docs/languages/php/extensions.md) to enable. |
| `disabled_extensions` | List of `string`s | PHP | [PHP extensions](https://developer.upsun.com/docs/languages/php/extensions.md) 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](#sizing-hints) | 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](https://developer.upsun.com/docs/languages/php/xdebug.md). |

You can also set your [app's runtime timezone](https://developer.upsun.com/docs/configure-apps/timezone.md).

### Extensions

> [!NOTE]
>
> To install multiple runtimes and tools in your application container, use the Upsun Cloud composable image.\\
>
> If you arrived here from another page and you are using the composable image, you enable and disable extensions by using the `stack.runtimes.extensions`/`stack.runtimes.disabled_extensions` keys.\\
>
> For details and an example, see the [`stack`](https://developer.upsun.com/docs/configure-apps/app-reference/composable-image#stack) section in the "Composable image" topic.

You can enable [PHP extensions](https://developer.upsun.com/docs/languages/php/extensions.md) just with a list of extensions:


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       type: 'php:\{\{version:php:latest}}'
&#x20;       source:
&#x20;         root: "/"
&#x20;       runtime:
&#x20;         extensions:
&#x20;           \- geoip
&#x20;           \- tidy

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


&#x20;   applications:
&#x20;     \<APP\_NAME>:
&#x20;       type: 'php:\{\{version:php:latest}}'
&#x20;       source:
&#x20;         root: "/"
&#x20;       runtime:
&#x20;         extensions:
&#x20;           \- geoip
&#x20;           \- name: blackfire
&#x20;             configuration:
&#x20;               server\_id: \<SERVER\_ID>
&#x20;               server\_token: \<SERVER\_TOKEN>

In this case, the `name` property is required.

### Sizing hints

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](https://developer.upsun.com/docs/languages/php/fpm.md).

## Resources (CPU, memory, and disk space)

By default, Upsun Cloud assigns a container profile and container size to each application and service on the first deployment of a project. \


The container *profile* defines and enforces a specific CPU-to-memory ratio. The default container profile for an app or service in a composable image is `HIGH_CPU`.

Use the Upsun Cloud CLI or Console to manually adjust the allocated container *size* (CPU and memory resources)—that is, to perform a **vertical‑scaling** action. When you redeploy, the container runs with the CPU‑to‑memory ratio defined by its profile, so it enforces the size you specified.

Related topics:

* For detailed steps for changing the container size, see the [Vertical scaling](https://developer.upsun.com/docs/manage-resources/adjust-resources.md#vertical-scaling) section of the "Resource configuration topic.
* For details about container sizes for each resource allocation strategy (shared CPU, guaranteed CPU, and initial allocation), see the [Advanced: Container profiles](https://developer.upsun.com/docs/manage-resources/adjust-resources.md#advanced-container-profiles) section of the "Resource configuration" topic.
* To learn more about general resource management in Upsun Cloud, see the topics in the [Manage resources](https://developer.upsun.com/docs/manage-resources.md) section.

### Downsize a disk

You can reduce the target disk size of an app. Keep in mind:

* Backups created before the downsize are incompatible and cannot be used; you must [create new backups](https://developer.upsun.com/docs/environments/backup.md).
* The downsize will fail if the disk contains more data than the target size.

### Combine single-runtime and composable images

In a [multiple application context](https://developer.upsun.com/docs/configure-apps/multi-app),
you can use a mix of single-runtime images
and [composable images](https://developer.upsun.com/docs/configure-apps/app-reference/composable-image.md).

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](https://developer.upsun.com/docs/configure-apps/app-reference/composable-image.md#php-as-a-primary-runtime) section in the Composable image topic.


&#x20;   applications:
&#x20;     frontend:
&#x20;       \# this app uses the single-runtime image with a specific node.js runtime
&#x20;       type: 'nodejs:\{\{version:nodejs:latest}}'
&#x20;     backend:
&#x20;       \# this app uses the composable image and specifies two runtimes
&#x20;       type: "composable:\{\{version:composable:latest}}"
&#x20;       stack:
&#x20;         runtimes:
&#x20;           \- "php\@8.4":
&#x20;               extensions:
&#x20;                 \- apcu
&#x20;                 \- sodium
&#x20;                 \- xsl
&#x20;                 \- pdo\_sqlite
&#x20;           \- "python\@3.13"
&#x20;         packages:
&#x20;           \- "python313Packages.yq" # python package specific


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.