Tailwind Logo

Prepare a project for XM1

Experience Manager (XM)

Published: 2023-01-11

In the previous article, we first created a project to serve as a template. In this article, we will proceed with the steps of removing and adjusting unnecessary items to make the project the simplest XM1 project to run.

Deployment of XM1 docker-compose file

Move the following three files in the folder run\sitecore-xm1 to the top level.

  • run\sitecore-xm1\.env
  • run\sitecore-xm1\docker-compose.override.yml
  • run\sitecore-xm1\docker-compose.yml

Delete the run folder, as the other configurations are not needed at this time. The file changes will look something like this

clean01.png

Remove unwanted Docker images

While there are many images that can be configured for XP1, there are many files under the docker that are not needed for XM1. To check which ones are needed, we will first leave the dockerfile used in the docker-compose.override.yml file. The required files are as follows

  • docker/build/cd
  • docker/build/cm
  • docker/build/id
  • docker/build/mssql-init
  • docker/build/nodejs
  • docker/build/redis
  • docker/build/rendering
  • docker/build/solr-init

Domain name fine-tuning

Regarding the domain name to run locally, which is listed for .env files and init.ps1, we would like to change this domain this time. If you don't mind this work, it is fine, but since it is different from the domain we have been blogging about, we will just change it this time to make it consistent on the blog.

The domain names already set up are as follows

  • dockerstarter.localhost

Change this to the following domain name

  • sitecoredemo.localhost

To ensure that there were no omissions, changes were made in batches.

clean02.png

Project Initialization

Now that the above configuration is complete, we will update the .env file and other files as follows. First, rename the project.

Plain Text
COMPOSE_PROJECT_NAME=sitecoredemo-docker

Since SQL and Solr data are stored in different paths, rewrite as follows

Plain Text
LOCAL_DEPLOY_PATH=.\docker\deploy\
LOCAL_DATA_PATH=.\docker\data\

Then modify the init.ps1 file. This time we are moving the relevant files to the top level, so we change the workinDirectoryPath path.

Plain Text
$workinDirectoryPath = ".\"

You are now ready to go. The commands should be executed in a terminal with administrative privileges.

PowerShell
.\init.ps1 -InitEnv -LicenseXmlPath "C:\projects\license\license.xml" -AdminPassword "DesiredAdminPassword" -Topology xm1
clean03.png

Docker-compose related updates

Then rewrite the path to the docker file because the docker-compose.override.yml file has been moved. If the relative path is ... /... /docker/build/ to docker/build/.

clean04.png

Also, since the solution files are in the same folder, change the path as follows

Dockerfile
build:
  context: .

The path to rendering volumes is also rewritten as follows

Dockerfile
rendering:
  volumes:
    - .\src\rendering:C:\app

Finally, rewrite the path to the certificate used by traefik.

Dockerfile
traefik:
  volumes:
    - ./docker/traefik:C:/etc/traefik

XM1 is now ready to be activated.

Execution.

Before starting the container, check the status of the following folders. First, the data you plan to serialize is not very well prepared.

clean05.png

Create a folder for the container used in Rendering as it requires a folder src↪rendering (this folder will be used later to create the Next.js project).

clean06.png

We will now perform the first initial setup. The commands are simple and are as follows

PowerShell
docker compose up -d

Download the container image if necessary, and finally XM1 will be activated. You can log in to the management screen by accessing the following URL

  • https://cm.sitecoredemo.localhost/sitecore

If you could log in as follows, you could start XM1 in a container.

clean07.png

Summary

We have shown you how to launch an XM1 image from a project template. By removing the data used by XP, and changing the paths defined in `docker-compose.override.yml`, we were able to create a simple XM1 image.

Tags