This page describes how things work on Grid projects. Dedicated Gen 3 projects are similar, but they run on dedicated virtual machines and each container is replicated three times.
For Dedicated Gen 2 projects, read about how Dedicated Gen 2 projects are structured.
Each environment you deploy on Platform.sh is built as a set of containers. Each container is an isolated instance with specific resources.
Each environment has 2 to 4 types of containers:
- One router (configured in a
- One or more app containers (configured in
- Zero or more service containers (configured in a
- Zero or more worker containers (configured in the files for apps)
If you have two app containers, two services (a database and a search engine), and a worker, requests to your environment might look something like this:
If you have only one app container, your repository might look like this:
project ├── .git ├── .platform │ ├── routes.yaml │ └── services.yaml ├── .platform.app.yaml └── <YOUR_APP_FILES>
Each environment always has exactly one router.
This router maps incoming requests to the appropriate app container and provides basic caching of responses, unless configured otherwise.
The router is configured in a
If you don’t include configuration, a single default route is deployed.
Read more about how to define routes.
You always need at least one app container, but you can have more.
App containers run the code you provide via your Git repository. They handle requests from the outside world and can communicate with other containers within the environment. Each app container is built from a specific language image with a given version for the language.
To configure your apps, you usually create one
.platform.app.yaml file for each app container.
A basic app generally has only one such file placed in the repository root.
Read more about how to configure apps.
You don’t need any service containers, but you can add them as you like.
Service containers run predefined code for specific purposes, such as a database or search service. You don’t need to add their code yourself, just set up how your apps communicate with them.
Service containers are configured by the
Read more about how to add services.
You don’t need any worker containers, but you can add them as you like.
Worker containers are copies of an app containers that have no access to the outside world and can have a different start command. They’re useful for continually running background processes.
Read more about how to work with workers.