Enabling development-only configuration

Version: 10.1

You can embed Sitecore configuration patches in your Visual Studio solution and layer them onto Sitecore images in your Dockerfiles. You can also apply configuration transforms to Sitecore containers in your Dockerfiles. These are appropriate for configuration changes that you want to embed in your immutable container images and deploy to testing, staging, and production environments.

Note

To get most benefit from container-based development and deployment, use the same container images in all environments whenever possible.

During development, you might want to make configuration changes that you do not want to persist in the container image for upstream environments. When possible, use environment variables or rule-based configuration to do this. However, some Web.config settings are difficult to configure with environment variables, and there are some common Sitecore configurations that a developer might want to quickly turn on or off during certain development tasks, or to decrease platform start-up time.

Sitecore Docker Tools include support for applying development-only configuration changes during container startup for these use cases. Sitecore Docker Tools ensure that the changes do not persist into upstream environments by making them part of the container entry point.

The Sitecore Docker Tools development entry point uses the SITECORE_DEVELOPMENT_PATCHES environment variable to configure Web.config transforms and Sitecore configuration patches that are applied at startup. This environment variable is expected to contain a comma-delimited list of folder names from the \tools\dev-patches folder:

RequestResponse
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff,DebugOn,RobotDetectionOff

Sitecore Docker Tools includes a number of configuration patches for common developer scenarios, including:

See the Sitecore Docker Tools GitHub repository for a list of all included patches.

Note

You can add your own patches by copying them into the dev-patches folder in your Dockerfile.

Do you have some feedback for us?

If you have suggestions for improving this article,