Tips for working with Coveo For Sitecore in Docker

In the previous post I shared how you create Coveo for Sitecore variant docker images. In this post i’ll share some tips when running Coveo for Sitecore in a Container how to configure and persist your trial organization details.

Configure & Persist Coveo Organization

If you followed by previous post, when you docker compose up for the first time you will have a vanilla Sitecore 9.3 instance and with a vanilla Coveo for Sitecore Module installed. The module needs to be configured with your developer trial license and organization details.

  1. Before we configure our developer trial license lets take a peek in the container filesystem you will have the bunch config files for Coveo but the following disabled configs are important:
  • App_Config/Include/Coveo/coveo.searchprovider.custom.config.example
  • App_Config/Modules/Coveo/coveo.searchprovider.config.example
  • App_Config/Modules/Coveo/coveo.searchprovider.rest.config.example
  • App_Config/Modules/Coveo/coveo.ui.components.experienceeditor.config.example
  • App_Config/Modules/Coveo/coveo.ui.controls.config.example

2. If we go through the trial Sitecore activation process:

3. Now if we check the file system again of our container the above disabled config files are now enabled:

  • App_Config/Include/Coveo/coveo.searchprovider.custom.config
  • App_Config/Modules/Coveo/coveo.searchprovider.config
  • App_Config/Modules/Coveo/coveo.searchprovider.rest.config
  • App_Config/Modules/Coveo/coveo.ui.components.experienceeditor.config
  • App_Config/Modules/Coveo/coveo.ui.controls.config

4. Also the following config files have been added:

  • App_Config/Include/Coveo/Coveo.CloudPlatformClient.Custom.config
  • App_Config/Include/Coveo/Coveo.SearchProvider.Rest.Custom.config

5. These changes to the configuration are important to allow you to persist your developer trial organization configuration in your docker containers.

You need to copy these settings out of the container and added back when you docker-compose up to ensure you configuration is persisted.

The following settings will change per developer per trial license period so bare that in mind when considering including them in your solution as these settings cannot be shared and will expire each month.

coveo.searchprovider.custom.config:

     </defaultIndexConfiguration>
        ...
        ..
        .   
        </documentOptions>
        <farmName>MyCoveoSitecoreDockerTrial</farmName>
        <sitecoreUsername>sitecore\admin</sitecoreUsername>
        <sitecorePassword>HsvttHf6dV+5Uf7FVHv6sg==</sitecorePassword>
        <securityConfiguration>
          <indexPermissions>False</indexPermissions>
        </securityConfiguration>
        <indexCommunicationFactory>
          <patch:attribute name="ref">coveo/cloudPlatformCommunicationFactory</patch:attribute>
        </indexCommunicationFactory>
      </defaultIndexConfiguration>

Coveo.CloudPlatformClient.Custom.config:

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:coveo="http://www.sitecore.net/coveo/">
  <sitecore coveo:require="!disabled">
    <coveo>
      <cloudPlatformConfiguration type="Coveo.Framework.Configuration.CloudPlatformConfiguration, Coveo.Framework">
        <apiKey>Y9f3xGoLD3OzxSOfg67aScSuQwG0OwyupPI5O3DEYhPiK9aNkfG0423z7C3kcfd+</apiKey>
        <organizationId>simplotscnkdevoctegb9yonc</organizationId>
        <searchApiKey>ZQaads+ZALI/TkDEFilDg9nnUqwFbzNOyqIKMRHnZxoItGcNH0LSC644Rzi3dpMf</searchApiKey>
        <indexingEndpointUri>https://push.cloud.coveo.com</indexingEndpointUri>
        <cloudPlatformUri>https://platform.cloud.coveo.com</cloudPlatformUri>
      </cloudPlatformConfiguration>
    </coveo>
  </sitecore>
</configuration>

Renew Coveo Trial License

Each month your Coveo License expires to renew follow these steps:

  1. docker-compose down
  2. Remove all content from your publish/web directory
  3. docker-compose up – so you have a vanilla instance so the modified coveo configuration files are removed.
  4. Follow the normal process for creating a new Coveo Trial Organization
  5. The following 3 files in App_Config\Includes\Coveo will get updated with your Trial Organization details:
    • coveo.CloudPlatformClient.Custom.config
    • coveo.searchprovider.custom.config
    • coveo.SearchProvider.Rest.Custom.config
  6. Copy these files out of the container using powershell script, Sitecore File explorer or create a Sitecore package along with all the content of App_Config/Modules/Coveo. Persist these file and deploy them to your solution along with the enabled config files mentioned earlier. Don’t commit to your source control repo as they are specific to you for the current trial period.
  7. Build Coveo Indexes.

Choosing the correct Trial Type

Coveo provides two trial types you can choose from Enterprise or Pro. Make sure you select the correct trial that matches your clients Production License. This ensures you only develop against features the client is licensed to use.

Useful Links

Have fun!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s