Customizing the Web server Docker container

If you need to customize the Web server Docker container, you can create customized configuration files and build a new Web server Docker image.

You can customize the httpd.conf and plugin-cfg.xml files.
Note:

Procedure

  1. Copy the httpd.conf and plugin-cfg.xml files to your Docker host machine to edit.
    For example,
    docker cp web_container_name:/opt/WebSphere/Plugins/config/templates/plugin-cfg.xml .
    and
    docker cp web_container_name:/opt/WebSphere/HTTPServer/conf/httpd.conf .
    The period (.) at the end of the command copies the files to the current working directory. Modify the command if you want to copy to a different directory.
  2. Edit the httpd.conf and plugin-cfg.xml files to add forward requests or request limitations.
    Note: Ensure that you adhere to the following configuration guidelines when editing the files.
    • For httpd.conf, do not remove the existing virtual host definition. You can add new records to the existing virtual host definition, or add a new virtual host definition with a new port.
    • For plugin-cfg.xml, do not remove the existing Uri, Urigroup, VirtualHostGroup, Route, and Servercluster definitions. You can add new records to the existing definitions or create new definitions for these objects.
  3. Create a Dockerfile with the following contents.
    FROM Docker_registry/commerce/ts-web:source_image_tag
    RUN yum install -y nc && yum clean all HEALTHCHECK --interval=10s CMD nc localhost 8000 < /dev/null 
    #If you migrated from HCL Commerce V7 or V8, and are using the migrated local store, uncomment the next line.  
    #COPY localStoreStaticAsset/ /SETUP/Cus/ 
    #For local store assets, there is a built-in request forward configuration in httpd.conf and plugin-cfg.xml. 
    #The built-in store configuration is only needed for the migrated local store, not the Version 9 remote store.
    COPY SETUP /SETUP
    Docker_registry
    The Docker registry URL where the source image is located.
    source_image_tag
    The tag of the source image that you want to use.
  4. Create a SETUP/config folder in the same directory as the Dockerfile.
    Your directory structure should resemble the following tree.
    • Dockerfile
    • SETUP
      • Config
  5. Move the customized httpd.conf and plugin-cfg.xml files to the /SETUP/config folder.
  6. Build the new Web server Docker image.

    For information about how to build, see Dockerfile reference.

    If you want to use Docker Compose, you can reference the following topic that shows how to update your compose file, Building a custom Docker image from a deployable package.