Configure services


In the previous step, you created a collection of empty configuration files that will allow the project to be deployed on Platform.sh.

Now you will need to include information that will tell Platform.sh how you want your application to connect to its services in a .platform/services.yaml file.

With the following project structure:

.
├── .platform
│   ├── routes.yaml
│   └── services.yaml
├── .platform.app.yaml
└── < application code >

An example .platform/services.yaml will look something like this:

.platform/services.yaml

# The services of the project.
#
# Each service listed will be deployed
# to power your Platform.sh project.

db:
    type: mariadb:10.4
    disk: 2048

cache:
    type: redis:6.0

If your application does not use any services at this point then you can leave it blank, but it must exist in your repository to run on Platform.sh. If your application does use a database or other services, you can configure them with the following attributes:

  • name: Provide a name for the service, so long as it is alphanumeric. If your application requires multiple services of the same type, make sure to give them different names so that your data from one service is never overwritten by another.

  • type: This specifies the service type and its version using the format

    type:version
    

    Consult the table below that lists all Platform.sh maintained services, along with their type and supported versions. The links will take you to each service’s dedicated page in the documentation.

    Service type Supported version
    Headless Chrome chrome-headless 73
    Elasticsearch elasticsearch 6.5, 7.2, 7.5, 7.7, 7.9
    InfluxDB influxdb 1.2, 1.3, 1.7, 1.8
    Kafka kafka 2.1, 2.2, 2.3, 2.4, 2.5
    MariaDB mariadb 10.0, 10.1, 10.2, 10.3, 10.4, 10.5
    Memcached memcached 1.4, 1.5, 1.6
    MongoDB mongodb 3.0, 3.2, 3.4, 3.6
    Network Storage network-storage 1.0
    Oracle MySQL oracle-mysql 5.7, 8.0
    PostgreSQL postgresql 9.6, 10, 11, 12, 13
    RabbitMQ rabbitmq 3.5, 3.6, 3.7, 3.8
    Redis redis 3.2, 4.0, 5.0, 6.0
    Solr solr 7.7, 8.0, 8.4, 8.6
    Varnish varnish 5.6, 6.0
  • disk: The disk attribute configures the amount of persistent disk that will be allocated between all of your services. Projects by default are allocated 5 GB (5120 MB), and that space can be distributed across all of your services. Note that not all services require disk space. If you specify a disk attribute for a service that doesn’t use it, like Redis, you will receive an error when trying to push your changes.

Platform.sh provides managed services, and each service comes with considerable default configuration that you will not have to include yourself in services.yaml.

Next, you will next need to tell Platform.sh how to build and deploy your application using the .platform.app.yaml file.