In the previous step, you created a collection of empty configuration files that have given your project the following structure:
├── .platform │ ├── routes.yaml │ └── services.yaml ├── .platform.app.yaml └── < application code >
Now you will need to include information that will tell Platform.sh how you want your application to connect to its services. An example
.platform/services.yaml will look something like this:
# This file defines services you want available to your application. elasticsearch: type: elasticsearch:7.2 disk: 256 size: S influxdb: type: influxdb:1.7 disk: 256 size: S kafka: type: kafka:2.2 disk: 512 size: S memcached: type: memcached:1.4 size: S mongodb: type: mongodb:3.6 disk: 1024 size: S mysql: type: mariadb:10.4 disk: 256 size: S postgresql: type: postgresql:11 disk: 256 size: S rabbitmq: type: rabbitmq:3.7 disk: 256 size: S redis: type: redis:5.0 size: S solr: type: solr:8.0 disk: 256 size: S configuration: cores: maincore: conf_dir: !archive "solr-config" endpoints: solr: core: maincore
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
Consult the table below that lists all Platform.sh maintained services, along with their
versions. The links will take you to each service's dedicated page in the documentation.
||1.2, 1.3, 1.7|
||2.1, 2.2, 2.3, 2.4|
||10.0, 10.1, 10.2, 10.3, 10.4|
||1.4, 1.5, 1.6|
||3.0, 3.2, 3.4, 3.6|
||9.6, 10, 11, 12|
||3.5, 3.6, 3.7, 3.8|
||3.2, 4.0, 5.0|
||3.6, 4.1, 6.3, 6.6, 7.6, 7.7, 8.0, 8.4|
diskattribute 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
diskattribute for a service that doesn't use it, like Redis, you will receive an error when trying to push your changes.
Each language and framework may have additional attributes that you will need to include in
.platform/services.yamldepending on the needs of your application. To find out what else you may need to include to configure your services, consult
The Services documentation for Platform.sh
The documentation goes into far more extensive detail of which attributes can also be included for service configuration, and should be used as your primary reference.
Language-specific templates for Platform.sh Projects
.platform/services.yamlfile from the simple template above to other templates when writing your own.
Platform.sh provides managed services, and each service comes with considerable default configuration that you will not have to include yourself in
Next, you will next need to tell Platform.sh how to build and deploy your application using the