Developer Guide > Developer Guide > Codebeamer Developer Tools > Docker > Running Codebeamer and Pure Variants Using Common Docker Template
Running Codebeamer and Pure Variants Using Common Docker Template
Before installing Pure Variants and Codebeamer using a common Docker template, complete the following prerequisites:
1. Download the .zip file from the PTC eSupport site.
2. Download the Pure Variants Docker Setup package from the Pure Variants product web page. For download instructions, see Pure Variants Deployment Templates for Docker.
To verify the supported Pure Variants version, refer to the PTC Release Advisor for your Codebeamer version.
3. After you download and extract both the packages, copy the content of both into one folder.
4. Both the packages contain *.env.template_x parameter templates files for different purposes. These files need be merged into one .env file and placed in the top folder of the directory structure.
The detailed description of Pure Variants related parameter templates can be found in Pure Variants Deployment Templates for Docker. For the description of Codebeamer related information see Codebeamer Configuration values in the .env file.
Once you complete these prerequisites, proceed with the installation process using the common Docker template as outlined the section below.
Installing Codebeamer and Pure Variants
The Codebeamer and Pure Variants can now be installed simultaneously using a common docker template. This docker template contains the common configuration parameters that are critical for both Codebeamer and Pure variants installation.
The combined template package contains the following directories:
.mappings: This directory contains the required configuration entries.
Generally, you do not need to modify these entries.
tools: This directory contains a script called create_self_signed_certificate.sh that can be used to generate the self-signed certificate based on the configuration in the .env file and places them into the workspace/certificates/ directory. This is an alternative to use your own certificate in the deployment. You can add your own certificates in the workspace/certificates/ directory using the name server.crt for the certificate and server.key for private key.
workspace: Contains the files that are mounted on the containers.
env.template_X: This file contains the Pure Variants configuration entries.
cb.env.template_Y: This file contains the Codebeamer configuration entries.
compose.yaml: It is the docker compose file that contains the Docker Compose configuration for Pure Variants.
cb.compose.yaml: It is the docker compose file that contains the Docker Compose configuration for Codebeamer.
The Codebeamer and Pure variants can now be installed simultaneously using a common docker template. This docker template contains the common configuration and integration parameters that are critical for both Codebeamer and Pure variants installation.
Licensing Pure Variants
To use Pure variants with Codebeamer you need a running license server configured with a valid license.
Licensing Codebeamer
In the .env file, you can configure the CB_MAC_ADDRESS and CB_LICENSE environment variables. To do this, you need to obtain a license that corresponds to the MAC address recognized by Codebeamer. You can override this MAC address using the CB_MAC_ADDRESS environment variable. After acquiring the license, set the value of CB_LICENSE to the acquired license.
Codebeamer Configuration Values in the .env File.
The following environment variables in the .env file define key Codebeamer properties, such as the image version, host name, ports, and database version:
CB_VERSION: The tag of the Codebeamer image that is to be used.
CB_EXPOSED_HOST: The hostname of the Codebeamer instance.
CB_EXPOSED_PORT: The HTTPS port of the Codebeamer instance.
CB_EXPOSED_HTTP_PORT: The HTTP port of the Codebeamer instance.
CB_DB_VERSION: The postgres data base version. This is important only if no external database is used.
Configuring Basic Authentication for Codebeamer and Pure Variants
Before you configure the authentication for Codebeamer and Pure Variants, you must first build the Docker images for both the applications. For more information on how to build a docker image in Codebeamer, see Building a Docker Image for Codebeamer and Pure Variants Deployment Templates for Docker.
Once you have configured and built the docker image, follow the below given steps to configure basic authentication for Codebeamer and Pure Variants:
1. Navigate to your root directory and run the following command ./tools/create_self_signed_certificate.sh. This command generates the self-signed certificates that are then picked up by the gateway components.
2. Configure the env.template_a, and cb.env_template_a files to use basic authentication, or use env.template_b/env_template_c and cb.env_template_b for SSO. Then merge the selected env.template_X and cb.env.template_Y files into a .env file in the root directory.
3. Run the docker compose -f compose.yaml -f cb.compose.yaml up command. Once the environment starts, you can access the respective Codebeamer and Pure Variants instances. To know more about the Codebeamer and Pure Variants instances, see the section below.
Accessing the Codebeamer and Pure Variants Instances
The Codebeamer instance can be accessed at the following URL: https://<CB_EXPOSED_HOST>:<CB_EXPOSED_PORT>/<CB_CONTEXT_PATH>. You can configure all of these parameters in the .env file.
* 
The CB_CONTEXT_PATH is optional and should match the context path specified during the image creation if you are using newer versions of the Codebeamer image builder script.
The Pure Variants instance is available at https://<PV_EXPOSED_HOST>:<PV_EXPOSED_PORT>/pvweb. You can configure both parameters in the..env file.
The template provided by PTC does not perform the DNS resolution. You need to ensure that the specified hosts resolve to the locations where the Codebeamer and Pure Variants instances are running. By default, both the CB_EXPOSED_HOST and PV_EXPOSED_HOST are set to localhost. The script create_self_signed_certificate.sh generates a self-signed certificate for the name specified in the .env file by the PV_EXPOSED_HOST entry.
Verifying the Codebeamer and Pure Variants Integration
To verify the integration is successful, access your Codebeamer instance, create a demo project, and navigate to the supported tracker types. Check if the Pure Variants widget icon is visible in the right pane. For more information on enabling Pure variants widget in Codebeamer, see Enabling Pure Variants Widget in Codebeamer.
Was this helpful?