Sitecore JSS in containers

Find out how to setup an XP0 installation supporting Sitecore JSS on the cm/cd role. Basic knowledge of Sitecore JSS as described on is required.

To add JSS Server Components to your Sitecore server, 2 asset images are made available by Sitecore:

  • sxp/modules/jss-xm1-assets (to be used for xm topologies)
  • sxp/modules/jss-xp1-assets (to be used for xp topologies)

For our XP0 workerstation setup, we will use the jss-xp1-assets image.

Customize CM image

First let’s create a custom cm image. In docker-compose.override.xml we need to add a custom build.

We pass along, the base xp0 image, the tooling image and the jss-assets image. (You might also want to add your custom solution build image, but we will keep this out of scope for now.)

Moving to the Dockerfile of the CM build, we will take in the JSS_IMAGE and copy its contents from /module/cm/content into the CM base image. Next, we also want to copy some tools shipped in the JSS_IMAGE. We need to coy them as well and execute the initialize-content.ps1 script.

Customize MSSQL image

Next, we will have to install the Sitecore items of the JSS Server Components by creating a custom MSSQL image. In the docker-compose.override we need to add a section to build a custom mssql image.

In the dockerfile, we copy the dacpacs from the jss-asset image into the mssql image and execute the deploydatabases.ps1 script.

Node.JS is missing

Presuming you have created a jss-project and deployed it to your Sitecore instance (more info on, when you browse to your website now, you will receive an error explaining that node.js is missing.

To add node.js to our cm image, we will have to extends our custom cm build. First we will update the docker-compose.override to pass the build_image ( to the CM build. We could also pass “”, but opt to use the build image as we already use this one in our architecture.

Next, we will update the CM Dockerfile.

First let’s take in the build_image (line 5), and spin it up as a container “installer” (line 10). In this installer container, we will download nodejs (line 14), extract the zip file (line 15) and rename the extracted folder (line 16).

Next we will copy nodejs from the installer container to the nodejs folder of the custom cm image. (lines 33 + 34)

Finally, we will have to add the folder containing nodejs into the path of this containered windows. (line 35) Make sure to add the /m flag to change the system environment path instead of the user environment path.

Once we rebuild our images and spin up some new containers, we should have a working JSS website in containers!

4 thoughts on “Sitecore JSS in containers

    1. bart.verdonck says:

      Hi, I’m not sure on what version I used at the time of writing. Usualy, I tend to upgrade to the latest one. Best Regards

  1. Deepti says:

    I am also trying to find the JSS_VERSION. What should the overall path look like?

    JSS_IMAGE: ${SITECORE_MODULE_REGISTRY}jss-xp1-assets (What version goes here? Cant find anywhere). Latest doesnt work

  2. Dylan Young says:

    For those asking, JSS_VERSION is 16.0.0-1809 (obviously that’s the latest version. 1809 should be fine since you aren’t running this as a running docker image, or else you might have problems.


Leave a Reply

Your email address will not be published. Required fields are marked *