github.com/drud/ddev@v1.21.5-alpha1.0.20230226034409-94fcc4b94453/docs/content/users/extend/additional-services.md (about)

     1  # Additional Service Configurations & Add-ons
     2  
     3  DDEV projects can be extended to provide additional add-ons, including services. You can define these add-ons using docker-compose files in the project’s `.ddev` directory.
     4  
     5  Anyone can create their own services with a `.ddev/docker-compose.*.yaml` file, and a growing number of popular services are supported and tested, and can be installed using the [`ddev get`](../usage/commands.md#get) command.
     6  
     7  Use `ddev get --list` to see available add-ons. To see all possible add-ons (not necessarily supported or tested), use `ddev get --list --all`.
     8  
     9  For example,
    10  
    11  ```
    12  →  ddev get --list
    13  ┌──────────────────────────────────────┬───────────────────────────────────────────────────┐
    14  │ ADD-ON                               │ DESCRIPTION                                       │
    15  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    16  │ drud/ddev-adminer                    │ Adminer service for DDEV*                         │
    17  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    18  │ drud/ddev-beanstalkd                 │ Beanstalkd for DDEV*                              │
    19  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    20  │ drud/ddev-browsersync                │ Auto-refresh HTTPS page on changes with DDEV*     │
    21  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    22  │ drud/ddev-cron                       │ Schedule commands to execute within DDEV*         │
    23  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    24  │ drud/ddev-drupal9-solr               │ Drupal 9 Apache Solr installation for DDEV*       │
    25  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    26  │ drud/ddev-elasticsearch              │ Elasticsearch add-on for DDEV*                    │
    27  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    28  │ drud/ddev-memcached                  │ Install Memcached as an extra service in DDEV*    │
    29  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    30  │ drud/ddev-mongo                      │ MongoDB add-on for DDEV*                          │
    31  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    32  │ drud/ddev-pdfreactor                 │ PDFreactor service for DDEV*                      │
    33  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    34  │ drud/ddev-platformsh                 │ Add integration with Platform.sh hosting service* │
    35  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    36  │ drud/ddev-proxy-support              │ Support HTTP/HTTPS proxies with DDEV*             │
    37  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    38  │ drud/ddev-redis                      │ Redis service for DDEV*                           │
    39  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    40  │ drud/ddev-redis-commander            │ Redis Commander for use with DDEV Redis service*  │
    41  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    42  │ drud/ddev-selenium-standalone-chrome │ A DDEV service for running standalone Chrome*     │
    43  ├──────────────────────────────────────┼───────────────────────────────────────────────────┤
    44  │ drud/ddev-varnish                    │ Varnish reverse proxy add-on for DDEV*            │
    45  └──────────────────────────────────────┴───────────────────────────────────────────────────┘
    46  Add-ons marked with '*' are official, maintained DDEV add-ons.
    47  ```
    48  
    49  !!!tip
    50  If you need a service not provided here, see [Defining an Additional Service with Docker Compose](custom-compose-files.md).
    51  
    52  Officially-supported add-ons:
    53  
    54  * [Adminer](https://github.com/drud/ddev-adminer): `ddev get drud/ddev-adminer`.
    55  * [Apache Solr for Drupal 9](https://github.com/drud/ddev-drupal9-solr): `ddev get drud/ddev-drupal9-solr`.
    56  * [Beanstalkd](https://github.com/drud/ddev-beanstalkd): `ddev get drud/ddev-beanstalkd`.
    57  * [Browsersync](https://github.com/drud/ddev-browsersync): `ddev get drud/ddev-browsersync`.
    58  * [cron](https://github.com/drud/ddev-cron): `ddev get drud/ddev-cron`.
    59  * [Elasticsearch](https://github.com/drud/ddev-elasticsearch): `ddev get drud/ddev-elasticsearch`.
    60  * [Memcached](https://github.com/drud/ddev-memcached): `ddev get drud/ddev-memcached`.
    61  * [MongoDB](https://github.com/drud/ddev-mongo): `ddev get drud/ddev-mongo`.
    62  * [PDFreactor](https://github.com/drud/ddev-pdfreactor): `ddev get drud/ddev-pdfreactor`
    63  * [Platform.sh](https://github.com/drud/ddev-platformsh): `ddev get drud/ddev-platformsh`
    64  * [Proxy Support](https://github.com/drud/ddev-proxy-support): `ddev get drud/ddev-proxy-support`.
    65  * [Redis Commander](https://github.com/drud/ddev-redis-commander): `ddev get drud/ddev-redis-commander`.
    66  * [Redis](https://github.com/drud/ddev-redis): `ddev get drud/ddev-redis`.
    67  * [Selenium Standalone Chrome](https://github.com/drud/ddev-selenium-standalone-chrome): `ddev get drud/ddev-selenium-standalone-chrome`.
    68  * [Varnish](https://github.com/drud/ddev-varnish): `ddev get drud/ddev-varnish`.
    69  
    70  ## Creating an Additional Service for `ddev get`
    71  
    72  Anyone can create an add-on for `ddev get`. See [this screencast](https://www.youtube.com/watch?v=fPVGpKGr0f4) and instructions in [`ddev-addon-template`](https://github.com/drud/ddev-addon-template):
    73  
    74  1. Click “Use this template” on [`ddev-addon-template`](https://github.com/drud/ddev-addon-template).
    75  2. Create a new repository.
    76  3. Test it and preferably make sure it has valid tests in `tests.bats`.
    77  4. When it’s working and tested, create a release.
    78  5. Add the `ddev-get` label and a good short description to the GitHub repository.
    79  6. When you’re ready for the add-on to become official, open an issue in the [DDEV issue queue](https://github.com/drud/ddev/issues/new) requesting upgrade to official. You’ll be expected to maintain it, and subscribe to all activity and be responsive to questions.
    80  
    81  ### Sections and Features of ddev-get Add-On install.yaml
    82  
    83  The `install.yaml` is a simple YAML file with a few main sections:
    84  
    85  * `pre_install_actions`: an array of Bash statements or scripts to be executed before `project_files` are installed. The actions are executed in the context of the target project’s root directory.
    86  * `project_files`: an array of files or directories to be copied from the add-on into the target project’s `.ddev` directory.
    87  * `global_files`: is an array of files or directories to be copied from the add-on into the target system’s global `.ddev` directory (`~/.ddev/`).
    88  * `post_install_actions`: an array of Bash statements or scripts to be executed after `project_files` and `global_files` are installed. The actions are executed in the context of the target project’s root directory.
    89  * `yaml_read_files`: a map of `name: file` of YAML files to be read from the target project’s root directory. The contents of these YAML files may be used as templated actions within `pre_install_actions` and `post_install_actions`.
    90  
    91  In any stanza of `pre_install_actions` and `post_install_actions` you can:
    92  
    93  * Use `#ddev-nodisplay` on a line to suppress any output.
    94  * Use `#ddev-description:<some description of what stanza is doing>` to instruct DDEV to output a description of the action it's taking.
    95  
    96  You can see a simple `install.yaml` in [`ddev-addon-template`’s `install.yaml`](https://github.com/drud/ddev-addon-template/blob/main/install.yaml).
    97  
    98  ### Environment Variable Replacements
    99  
   100  Simple environment variables will be replaced in `install.yaml` as part of filenames. This can include environment variables in the context where DDEV run, as well as the standard [environment variables](custom-commands.md#environment-variables-provided) provided to custom host commands, like `DDEV_APPROOT`, `DDEV_DOCROOT`, etc. For example, if a file in `project_files` is listed as `somefile.${DDEV_PROJECT}.txt` with a project named `d10`, the file named `somefile.d10.txt` will be copied from the add-on into the project.
   101  
   102  ### Template Action Replacements (Advanced)
   103  
   104  A number of additional replacements can be made using Go template replacement techniques, using the format `{{ .some-gotemplate-action }}`. These are mostly for use of YAML information pulled into `yaml_read_files`. A map of values from each YAML file is placed in a map headed by the name of the YAML file. For example, if a YAML file named `example_yaml.yaml`:
   105  
   106  ```yaml
   107  value1: xxx
   108  ```
   109  
   110  is referenced using
   111  
   112  ```yaml
   113  yaml_read_files:
   114    example: example_yaml.yaml
   115  ```
   116  
   117  then `value1` can be used throughout the `install.yaml` as `{{ example.value1 }}` and it will be replaced with the value `xxx`.
   118  
   119  More exotic template-based replacements can be seen in an advanced test [example](https://github.com/drud/ddev/blob/master/cmd/ddev/cmd/testdata/TestCmdGetComplex/recipe/install.yaml).
   120  
   121  Go templating resources:
   122  
   123  * [Official Go template docs](https://pkg.go.dev/text/template)
   124  * [Lots of intro to Golang templates](https://www.google.com/search?q=golang+templates+intro&oq=golang+templates+intro&aqs=chrome..69i57j0i546l4.3161j0j4&sourceid=chrome&ie=UTF-8)
   125  * [masterminds/sprig](http://masterminds.github.io/sprig/) extra functions.
   126  
   127  ## Additional services in ddev-contrib (MongoDB, Elasticsearch, etc)
   128  
   129  Commonly-used services will be migrated from the [ddev-contrib](https://github.com/drud/ddev-contrib) repository to individual, tested, supported repositories, but the repository already has a wealth of additional examples and instructions:
   130  
   131  * **Headless Chrome**: See [Headless Chrome for Behat Testing](https://github.com/drud/ddev-contrib/blob/master/docker-compose-services/headless-chrome)
   132  * **Old PHP Versions to Run Old Sites**: See [Old PHP Versions](https://github.com/drud/ddev-contrib/blob/master/docker-compose-services/old_php)
   133  * **RabbitMQ**: See [RabbitMQ](https://github.com/drud/ddev-contrib/blob/master/docker-compose-services/rabbitmq)
   134  * **TYPO3 Solr Integration**: See [TYPO3 Solr](https://github.com/drud/ddev-contrib/blob/master/docker-compose-services/typo3-solr)
   135  
   136  Your pull requests to integrate other services are welcome at [ddev-contrib](https://github.com/drud/ddev-contrib).