This project provides a starter kit for Drupal 8 projects hosted on Platform.sh. It is very closely based on the Drupal Composer project.
To start a new Drupal 8 project on Platform.sh, you have 2 options:
-
Create a new project through the Platform.sh user interface and select "start new project from a template". Then select Drupal 8 as the template. That will create a new project using this repository as a starting point.
-
Take an existing project, add the necessary Platform.sh files, and push it to a Platform.sh Git repository. This template includes examples of how to set up a Drupal 8 site. (See the "differences" section below.)
You can also use this repository as a reference for your own Drupal projects, and borrow whatever code is needed. The most important parts are the .platform.app.yaml
file and the .platform
directory.
Also see:
settings.php
- The customizedsettings.php
file works for both Platform.sh and local development, setting only those values that are needed in both. You can add additional values as documented indefault.settings.php
as desired.settings.platformsh.php
- This file contains Platform.sh-specific code to map environment variables into Drupal configuration. You can add to it as needed. See the documentation for more examples of common snippets to include here.scripts/platformsh
- This directory contains our update script to keep this repository in sync with the Drupal Composer project. It may be safely ignored or removed.
Nothing is easier than managing a Composer-based Drupal site on Platform.sh. See Drupal 8 and Composer for details. For example adding a single module to your Drupal installation is as simple as:
composer require drupal/devel
git commit -am 'Add the Devel module'
git push
-
The
vendor
directory (where non-Drupal code lives) and theconfig
directory (used for syncing configuration from development to production) are outside the web root. This is a bit more secure as those files are now not web-accessible. -
The
settings.php
andsettings.platformsh.php
files are provided by default. Thesettings.platformsh.php
file automatically sets up the database connection on Platform.sh, and allows controlling Drupal configuration from environment variables. -
We include recommended
.platform.app.yaml
and.platform
files that should suffice for most use cases. You are free to tweak them as needed for your particular site.