.sb.yml
file which is a specification of the entire app’s configuration. Check .sb.yml file for more information.
.php.ini.d
. Create a file with the name drupal.ini
with the following contents.
.ini
.
.nginx.conf.d
and create a file with the following contents:
.conf
.
Here’s a reference implementation. https://github.com/shapeblock/drupal-10/blob/main/.nginx.conf.d/drupal-server.conf
settings.php
file by adding a custom settings.php which will pull database credentials from environment files.
settings.shapeblock.php
file in the same folder.
settings.prod.php
.settings.php
file during installation, even when we provide one. For this, we need to provide explicit write access to settings.php
.
The default container runtime in ShapeBlock is a readonly filesystem for security reasons. We have to provide explicit access to the settings.php
file.
For this, we have to create a chmod.sh
and give a list of file(s) and what permissions to give. In this case, the file will look like this:
drush
, some drush commands require the mysql-client package to be installed in the container. This is not installed by default.
We have to create a new file in the top level directory called Aptfile
and add the apt package name there.
BP_PHP_WEB_DIR
variable. For the above repo, it will be web
.
BP_PHP_WEB_DIR
relative to the directory structure of your code base.Variable Name | Value | Notes |
---|---|---|
BP_PHP_SERVER | nginx | Indicates what web server we will be using. |
BP_RUN_COMPOSER_INSTALL | 1 | A Drupal specific build variable which tells not to wipe out composer installed packages in the code base, i.e. the contrib modules and themes. Not needed for other PHP frameworks. |
BP_PHP_ENABLE_CACHE_CONTROL | false | Disable nginx cache control, which messes with Nginx serving aggregated and compressed Drupal static files. |
BP_PHP_VERSION | Latest version of PHP | Optional. Supports 8.1 and 8.2 |
settings.php
. You can change either the variable names here or in the settings.php
file accordingly.Variable Name | Value | Notes |
---|---|---|
DB_HOST | <service name>-mysql | Hostname of the mysql service which is attached. |
DB_NAME | shapeblock | Name of the database |
DB_USER | shapeblock | Name of the DB user who has access to the above database. |
DB_PASSWORD | shapeblock | Password for the DB user above |
HASH_SALT
secret to be provided.
Variable Name | Value | Notes |
---|---|---|
HASH_SALT | <some generated secret string> |
Mount Name | Mount path | Size | Notes |
---|---|---|---|
public-files | /workspace/web/sites/default/files | 2GiB | The name of the mount is arbitrary and for your reference only. |
/workspace
directory of the container. In our Drupal app, the public files directory will be /workspace/web/sites/default/files
.