Sitecore 10 with Docker – Create a solution from the scratch – Setting up the first docker instance

Setup
First of all i am not an expert in Docker, but i wanted to know how i can set up a whole Sitecore solution from the scratch, with modules rendering host etc.
As i have not found any tutorial which describes on how to do it i tried it my self, by digging deeper into the materia.
I took all existing examples as blueprint to understand what’s going on behind the scene.
In this Series we will go together through the whole process.
We will setup a XM environment with a connected rendering ASP.NET rendering host using SXA-JSS.
Let’s take the “Getting-Started” template as a base.
Yes i know it’s not really starting from the scratch, but we will modify almost everything in it. We are using it just for show case reasons.
The “Getting started” template of the docker-examples contains the docker configuration of a Vanilla Sitecore 10 XP instance, without a Visual Studio solution. So for our use case even the docker compose file is not really helpful. What we will use from this is the Init.ps1, the clean.ps1 and the .env file.
We will :
1. Adjust the docker-compose
2. Adjust the clean.ps1
3. Modify the folder structure
4. Add new files & folders.
Let’s start!
At the beginning the folder contains following:

We can use following documentation to get it running the first time https://doc.sitecore.com/xp/en/developers/101/developer-tools/run-your-first-sitecore-instance.html
Anyway you can bypass the detailed steps by calling
.\init.ps1 -LicenseXmlPath "<your licensepath here>"
(Now you know why we choose the Init.ps1 to keep as an arttifact ;))
After the initialization we are able to run
docker-compose up -d
Afterwards we can access Sitecore under https://xp0cm.localhost/sitecore
As long as we have not added a custom Sitecore Password in the Init command you can examine the .env file to find the default password.

We see a vanilla XP0 instance without any module installed.
In the next parts we are going to change the whole solution to a XM environment, add Sitecore Powershell Extensions, Sitecore SXA-JSS and configure the environment to use rendering host with SXA-JSS and Sitecore CLI.