Deploying updated Docker images with Docker Compose (for non-production usage)

Updates for HCL Commerce production environments are delivered as Docker images. To update your production environment: download newer release images, and rebuild them as custom images to include your custom code. You then deploy the custom containers.

Before you begin

About this task

The process of deploying HCL Commerce with Docker Compose was updated in the 9.1.6.0 release.

Improvements include:

  • A simplified directory structure for mounted volumes.
    • For the ease of import of essential files into your Docker images, without the need to create or recreate custom images;
    • For persistence of HCL Commerce demo data, in the event that your containers are taken offline or restarted.
    • HCL Commerce Version 9.1.12.0 or laterAutomated deployment of Docker images for use within an HCL Commerce development environment.
    For more information on mounted volumes, see The Docker Compose deployment /volumes/ directory structure and contents.
  • Improved deployment automation. Simply update the required environment information and run a script to configure and deploy HCL Commerce and related applications. This eliminates the need to manual edit your deployment files, which can be error-prone.

    For more information on deployment configuration, see The Docker Compose deployment env.sh configuration file.

Due to these improvements, the following procedure varies between releases.

Procedure

  1. Clean up any preexisting deployment.
    1. Bring down any active deployment.

      HCL Commerce Version 9.1.6.0 or laterIf you are using a release of HCL Commerce 9.1.6.0, or greater, use the teardown script, teardown.sh, or the docker-compose down command.

      For more information, see the tear down script description within Deploying HCL Commerce Version 9.1.6.0 or greater with Docker Compose (for non-production usage).

      If you are using Docker Compose with a version of HCL Commerce before 9.1.6.0,
      docker-compose -f path_to_compose_yml stop
    2. Remove the old containers.
      For example, run one of the following commands.
      • If your database is running in a Docker container and the container is defined in your Docker Compose YML file, remove all containers except for the database container. If you remove the database container, then you lose your data.
        For example, for an authoring environment, with a a Solr-based search solution,
        docker-compose -f path_to_compose_yml rm redis txn web tooling-web search_master store
      • If your database is not running in a Docker container, then you can use the following command.
        docker-compose -f path_to_compose_yml rm
  2. Update your environment, and deploy the latest version of the HCL Commerce containers.
    • HCL Commerce Version 9.1.6.0 or laterIf you are using a version of HCL Commerce 9.1.6.0 or greater:

      Complete the procedure outlined within Deploying HCL Commerce Version 9.1.6.0 or greater with Docker Compose (for non-production usage).

    • If you are using a version of HCL Commerce prior to 9.1.6.0:
      1. Update the deployment with the newer Docker images.
        1. Open your existing Docker Compose YML files that you used to deploy your production environments.
        2. Update the image path in the YML file to point to the new Docker image.
          For example, for the Transaction server Docker image (ts-app), if you tagged the updated image as 9.0.0.1,
          Deploy with Docker Compose
          Example
          If you are pulling images from your organization's private Docker registry
          image: Private_Docker_registry/library/ts-app:9.0.0.1
          If you used docker load to load the Docker images locally
          image: commerce/ts-app:9.0.0.1
      2. Pull the new images and deploy the new containers.
        docker-compose -f path_to_compose_yml up -d
  3. Verify that the deployment is running updated containers.
    1. Run the following command.
      docker ps
      Ensure that the Docker container tags are the same as the tag that you defined in your deployment YML file.
    2. Enter each container and run the viewlabels command.
      For example,
      docker exec -it container_name bash
      /SETUP/bin/viewlabels
      Ensure that all container labels have the same date stamp.
  4. Build your search index on the updated environment.

Results

Changes to the default containers provided by HCL for HCL Commerce are now applied to your custom containers, and your production environments are updated.