diff --git a/README.md b/README.md index 6944d3dc..88110aab 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Welcome to the Sitecore Helix Examples Repository +The objective of this repository is to set up Sitecore helix project on any topology means xp0, xp1 and xm1 dynamically which will reduce your time to setup insatnce. The Sitecore Helix Examples are demonstrations of Sitecore Helix practices across various tooling and business scenarios. They are intended to demonstrate a wider variety diff --git a/examples/helix-basic-aspnetcore/.env b/examples/helix-basic-aspnetcore/.env index 06fa1e61..436113db 100644 --- a/examples/helix-basic-aspnetcore/.env +++ b/examples/helix-basic-aspnetcore/.env @@ -19,12 +19,14 @@ RENDERING_HOST=www.basic-company-aspnetcore.localhost SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/ SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ -SITECORE_VERSION=10.1-ltsc2019 -HEADLESS_SERVICES_VERSION=18.0-1809 -MANAGEMENT_SERVICES_VERSION=4.0-1809 -TOOLS_VERSION=10.1-1809 +SITECORE_VERSION=10.2.0-ltsc2019 +HEADLESS_SERVICES_VERSION=20.0.1-20H2 +MANAGEMENT_SERVICES_VERSION=4.2.1-20H2 +TOOLS_VERSION=10.2-1809 -SITECORE_ADMIN_PASSWORD= +SITECORE_ADMIN_PASSWORD=Password12345 +SQL_SERVER=mssql +SQL_SA_LOGIN=sa SQL_SA_PASSWORD= SOLR_CORE_PREFIX_NAME=sitecore TELERIK_ENCRYPTION_KEY= @@ -38,3 +40,4 @@ TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 TRAEFIK_ISOLATION=hyperv ISOLATION=default MEDIA_REQUEST_PROTECTION_SHARED_SECRET= +MSSQL_PORT=14330 \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/Dockerfile b/examples/helix-basic-aspnetcore/Dockerfile deleted file mode 100644 index 5b548fad..00000000 --- a/examples/helix-basic-aspnetcore/Dockerfile +++ /dev/null @@ -1,42 +0,0 @@ -# escape=` - -ARG BASE_IMAGE -ARG BUILD_IMAGE - -FROM ${BUILD_IMAGE} AS prep - -# Gather only artifacts necessary for NuGet restore, retaining directory structure -COPY *.sln nuget.config Directory.Build.targets Packages.props \nuget\ -COPY src\ \temp\ -RUN Invoke-Expression 'robocopy C:\temp C:\nuget\src /s /ndl /njh /njs *.csproj *.scproj packages.config' - -FROM ${BUILD_IMAGE} AS builder - -ARG BUILD_CONFIGURATION - -SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] - -# Create an empty working directory -WORKDIR C:\build - -# Copy prepped NuGet artifacts, and restore as distinct layer to take better advantage of caching -COPY --from=prep .\nuget .\ -RUN nuget restore -Verbosity quiet - -# Copy remaining source code -COPY src\ .\src\ - -# Build the Sitecore main platform artifacts -RUN msbuild .\src\Environment\platform\BasicCompany.Environment.Platform.csproj /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\sitecore - -# Build the rendering host -WORKDIR C:\build\src\Project\BasicCompany\rendering\ -RUN dotnet publish -c $env:BUILD_CONFIGURATION -o C:\out\rendering --no-restore - -FROM ${BASE_IMAGE} - -WORKDIR C:\artifacts - -# Copy final build artifacts -COPY --from=builder C:\out\sitecore .\sitecore\ -COPY --from=builder C:\out\rendering .\rendering\ \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/cd/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/cd/Dockerfile index 1af6000a..cb7ed2c6 100644 --- a/examples/helix-basic-aspnetcore/docker/build/cd/Dockerfile +++ b/examples/helix-basic-aspnetcore/docker/build/cd/Dockerfile @@ -21,7 +21,7 @@ COPY --from=tooling C:\tools C:\tools COPY --from=headless_services C:\module\cd\content C:\inetpub\wwwroot COPY --from=headless_services C:\module\tools C:\module\tools RUN C:\module\tools\Initialize-Content.ps1 -TargetPath C:\inetpub\wwwroot; ` - Remove-Item -Path C:\module -Recurse -Force; + Remove-Item -Path C:\module -Recurse -Force; # Copy solution website files COPY --from=solution \artifacts\sitecore\ .\ \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/cm/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/cm/Dockerfile index ac47ee6f..02d0b918 100644 --- a/examples/helix-basic-aspnetcore/docker/build/cm/Dockerfile +++ b/examples/helix-basic-aspnetcore/docker/build/cm/Dockerfile @@ -26,7 +26,7 @@ COPY --from=management_services C:\module\cm\content C:\inetpub\wwwroot COPY --from=headless_services C:\module\cm\content C:\inetpub\wwwroot COPY --from=headless_services C:\module\tools C:\module\tools RUN C:\module\tools\Initialize-Content.ps1 -TargetPath C:\inetpub\wwwroot; ` - Remove-Item -Path C:\module -Recurse -Force; + Remove-Item -Path C:\module -Recurse -Force; # Copy solution website files COPY --from=solution \artifacts\sitecore\ .\ \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/cortexprocessing/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/cortexprocessing/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/cortexprocessing/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/cortexprocessingworker/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/cortexprocessingworker/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/cortexprocessingworker/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/cortexreporting/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/cortexreporting/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/cortexreporting/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/mssql/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/mssql-init/Dockerfile similarity index 63% rename from examples/helix-basic-aspnetcore/docker/build/mssql/Dockerfile rename to examples/helix-basic-aspnetcore/docker/build/mssql-init/Dockerfile index 5fe72802..9c8427f9 100644 --- a/examples/helix-basic-aspnetcore/docker/build/mssql/Dockerfile +++ b/examples/helix-basic-aspnetcore/docker/build/mssql-init/Dockerfile @@ -9,6 +9,4 @@ FROM ${BASE_IMAGE} SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # Copy and init the JSS / Headless Services Module -COPY --from=headless_services C:\module\db C:\jss_data -RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\jss_data; ` - Remove-Item -Path C:\jss_data -Recurse -Force; \ No newline at end of file +COPY --from=headless_services C:\module\db C:\jss_data \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/prc/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/prc/Dockerfile new file mode 100644 index 00000000..02a24575 --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/prc/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} diff --git a/examples/helix-basic-aspnetcore/docker/build/rep/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/rep/Dockerfile new file mode 100644 index 00000000..76b08526 --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/rep/Dockerfile @@ -0,0 +1,14 @@ +# escape=` + +ARG PARENT_IMAGE +ARG SOLUTION_IMAGE + +FROM ${SOLUTION_IMAGE} as solution +FROM ${PARENT_IMAGE} + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +WORKDIR C:\inetpub\wwwroot + +# Copy solution website files +COPY --from=solution \artifacts\website\ .\ \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/solution/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/solution/Dockerfile new file mode 100644 index 00000000..6b5fe581 --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/solution/Dockerfile @@ -0,0 +1,52 @@ +# escape=` + +# This Dockerfile will build the Sitecore solution and save the build artifacts for use in +# other images, such as 'cm' and 'rendering'. It does not produce a runnable image itself. + +ARG BASE_IMAGE +ARG BUILD_IMAGE + +# In a separate image (as to not affect layer cache), gather all NuGet-related solution assets, so that +# we have what we need to run a cached NuGet restore in the next layer: +# https://stackoverflow.com/questions/51372791/is-there-a-more-elegant-way-to-copy-specific-files-using-docker-copy-to-the-work/61332002#61332002 +# This technique is described here: +# https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/docker/building-net-docker-images?view=aspnetcore-3.1#the-dockerfile-1 +FROM ${BUILD_IMAGE} AS nuget-prep +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +COPY *.sln nuget.config Directory.Build.targets Packages.props /nuget/ +COPY src/ /temp/ +RUN Invoke-Expression 'robocopy C:/temp C:/nuget/src /s /ndl /njh /njs *.csproj *.scproj *.sln packages.config' + +FROM ${BUILD_IMAGE} AS builder +ARG BUILD_CONFIGURATION +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] + +# Ensure updated nuget. Depending on your Windows version, dotnet/framework/sdk:4.8 tag may provide an outdated client. +# See https://github.com/microsoft/dotnet-framework-docker/blob/1c3dd6638c6b827b81ffb13386b924f6dcdee533/4.8/sdk/windowsservercore-ltsc2019/Dockerfile#L7 +ENV NUGET_VERSION 5.8.1 +RUN Invoke-WebRequest "https://dist.nuget.org/win-x86-commandline/v$env:NUGET_VERSION/nuget.exe" -UseBasicParsing -OutFile "$env:ProgramFiles\NuGet\nuget.exe" + +WORKDIR /build + +# Copy prepped NuGet artifacts, and restore as distinct layer to take advantage of caching. +COPY --from=nuget-prep ./nuget ./ + +# Restore Platform NuGet packages +RUN nuget restore -Verbosity quiet + +# Copy remaining source code +COPY src/ ./src/ + +# Build the Sitecore main platform artifacts +RUN msbuild .\src\Environment\platform\BasicCompany.Environment.Platform.csproj /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\sitecore + +# Build the rendering host +WORKDIR C:\build\src\Project\BasicCompany\rendering\ +RUN dotnet publish -c $env:BUILD_CONFIGURATION -o C:\out\rendering --no-restore + +# Save the artifacts for copying into other images (see 'cm' and 'rendering' Dockerfiles). +FROM ${BASE_IMAGE} +WORKDIR /artifacts +COPY --from=builder C:/out/sitecore ./sitecore +COPY --from=builder C:/out/rendering ./rendering \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xconnect/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xconnect/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xconnect/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbautomation/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbautomation/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbautomation/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbautomationrpt/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbautomationrpt/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbautomationrpt/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbautomationworker/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbautomationworker/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbautomationworker/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbcollection/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbcollection/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbcollection/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbrefdata/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbrefdata/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbrefdata/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbsearch/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbsearch/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbsearch/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker/build/xdbsearchworker/Dockerfile b/examples/helix-basic-aspnetcore/docker/build/xdbsearchworker/Dockerfile new file mode 100644 index 00000000..f9f0817b --- /dev/null +++ b/examples/helix-basic-aspnetcore/docker/build/xdbsearchworker/Dockerfile @@ -0,0 +1,5 @@ +# escape=` + +ARG PARENT_IMAGE + +FROM ${PARENT_IMAGE} \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/down.ps1 b/examples/helix-basic-aspnetcore/down.ps1 new file mode 100644 index 00000000..6fae9551 --- /dev/null +++ b/examples/helix-basic-aspnetcore/down.ps1 @@ -0,0 +1,33 @@ +[CmdletBinding(DefaultParameterSetName = "no-arguments")] +Param ( + # use to run proper sitecore deployment setup + [string]$Topology +) + +$topologyArray = "xp0", "xp1", "xm1"; + +$startDirectory = ".\run\sitecore-"; +$workinDirectoryPath; +$envCheck; +$envCheckVariable = "HOST_LICENSE_FOLDER"; + +if ($topologyArray.Contains($Topology)) +{ + $envCheck = Get-Content (Join-Path -Path ($startDirectory + $Topology) -ChildPath .env) -Encoding UTF8 | Where-Object { $_ -imatch "^$envCheckVariable=.+" } + if ($envCheck) { + $workinDirectoryPath = $startDirectory + $Topology; + } +} + +Push-Location $workinDirectoryPath + +Write-Host "Down containers..." -ForegroundColor Green +try { + docker-compose down + if ($LASTEXITCODE -ne 0) { + Write-Error "Container down failed, see errors above." + } +} +finally { + Pop-Location +} diff --git a/examples/helix-basic-aspnetcore/init.ps1 b/examples/helix-basic-aspnetcore/init.ps1 index 9793fc37..94c7e0fd 100644 --- a/examples/helix-basic-aspnetcore/init.ps1 +++ b/examples/helix-basic-aspnetcore/init.ps1 @@ -1,91 +1,79 @@ -[CmdletBinding()] +[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingPlainTextForPassword', '', Justification='Value will be stored unencrypted in .env, +# and used only for transient local development environments', Scope='Function')] + +[CmdletBinding(DefaultParameterSetName = "no-arguments")] Param ( - [Parameter(Mandatory = $true)] - [string] - [ValidateNotNullOrEmpty()] - $LicenseXmlPath, + [Parameter(HelpMessage = "Enables initialization of values in the .env file, which may be placed in source control.", + ParameterSetName = "env-init")] + [switch]$InitEnv, + + [Parameter(Mandatory = $true, + HelpMessage = "The path to a valid Sitecore license.xml file.", + ParameterSetName = "env-init")] + [string]$LicenseXmlPath, [string] $HostName = "basic-company-aspnetcore", # We do not need to use [SecureString] here since the value will be stored unencrypted in .env, - # and used only for transient local example environment. - [string] - $SitecoreAdminPassword = "b" + # and used only for transient local development environments. + [Parameter(Mandatory = $true, + HelpMessage = "Sets the sitecore\\admin password for this environment via environment variable.", + ParameterSetName = "env-init")] + [string]$AdminPassword, + + # use to set sitecore deployment topology + [Parameter(Mandatory = $true, + HelpMessage = "Sets the instance topology", + ParameterSetName = "env-init")] + [ValidateSet("xp0","xp1","xm1")] + [string]$Topology ) +$topologyArray = "xp0", "xp1", "xm1"; +if (!$topologyArray.Contains($Topology)) { + throw "The topology $Topology is not valid. Please choose one from existed $($topologyArray -join ', ')" +} $ErrorActionPreference = "Stop"; +$workinDirectoryPath = ".\run\sitecore-$Topology" -if (-not (Test-Path $LicenseXmlPath)) { - throw "Did not find $LicenseXmlPath" -} -if (Test-Path $LicenseXmlPath -PathType Leaf) { - # We want the folder that it's in for mounting +if ($InitEnv) { + if (-not $LicenseXmlPath.EndsWith("license.xml")) { + Write-Error "Sitecore license file must be named 'license.xml'." + } + if (-not (Test-Path $LicenseXmlPath)) { + Write-Error "Could not find Sitecore license file at path '$LicenseXmlPath'." + } + # We actually want the folder that it's in for mounting $LicenseXmlPath = (Get-Item $LicenseXmlPath).Directory.FullName } +Write-Host "Preparing your Sitecore Containers environment!" -ForegroundColor Green + +################################################ +# Retrieve and import SitecoreDockerTools module +################################################ + # Check for Sitecore Gallery Import-Module PowerShellGet $SitecoreGallery = Get-PSRepository | Where-Object { $_.SourceLocation -eq "https://sitecore.myget.org/F/sc-powershell/api/v2" } if (-not $SitecoreGallery) { - Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green + Write-Host "Adding Sitecore PowerShell Gallery..." -ForegroundColor Green Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2 -InstallationPolicy Trusted $SitecoreGallery = Get-PSRepository -Name SitecoreGallery } -# Install and Import SitecoreDockerTools -$dockerToolsVersion = "10.1.4" + +# Install and Import SitecoreDockerTools +$dockerToolsVersion = "10.2.7" Remove-Module SitecoreDockerTools -ErrorAction SilentlyContinue -if (-not (Get-InstalledModule -Name SitecoreDockerTools -RequiredVersion $dockerToolsVersion -ErrorAction SilentlyContinue)) { +if (-not (Get-InstalledModule -Name SitecoreDockerTools -RequiredVersion $dockerToolsVersion -ErrorAction SilentlyContinue)) { Write-Host "Installing SitecoreDockerTools..." -ForegroundColor Green - Install-Module SitecoreDockerTools -RequiredVersion $dockerToolsVersion -Scope CurrentUser -Repository $SitecoreGallery.Name + Install-Module SitecoreDockerTools -RequiredVersion $dockerToolsVersion -Scope CurrentUser -Repository $SitecoreGallery.Name } Write-Host "Importing SitecoreDockerTools..." -ForegroundColor Green Import-Module SitecoreDockerTools -RequiredVersion $dockerToolsVersion Write-SitecoreDockerWelcome -############################### -# Populate the environment file -############################### - -Write-Host "Populating required .env file variables..." -ForegroundColor Green - -# HOST_LICENSE_FOLDER -Set-EnvFileVariable "HOST_LICENSE_FOLDER" -Value $LicenseXmlPath - -# CD_HOST -Set-EnvFileVariable "CD_HOST" -Value "cd.$($HostName).localhost" - -# CM_HOST -Set-EnvFileVariable "CM_HOST" -Value "cm.$($HostName).localhost" - -# ID_HOST -Set-EnvFileVariable "ID_HOST" -Value "id.$($HostName).localhost" - -# SITE_HOST -Set-EnvFileVariable "SITE_HOST" -Value "www.$($HostName).localhost" - -# SITECORE_ADMIN_PASSWORD -Set-EnvFileVariable "SITECORE_ADMIN_PASSWORD" -Value $SitecoreAdminPassword - -# SQL_SA_PASSWORD -Set-EnvFileVariable "SQL_SA_PASSWORD" -Value (Get-SitecoreRandomString 12 -DisallowSpecial -EnforceComplexity) - -# TELERIK_ENCRYPTION_KEY = random 64-128 chars -Set-EnvFileVariable "TELERIK_ENCRYPTION_KEY" -Value (Get-SitecoreRandomString 128) - -# MEDIA_REQUEST_PROTECTION_SHARED_SECRET -Set-EnvFileVariable "MEDIA_REQUEST_PROTECTION_SHARED_SECRET" -Value (Get-SitecoreRandomString 64) - -# SITECORE_IDSECRET = random 64 chars -Set-EnvFileVariable "SITECORE_IDSECRET" -Value (Get-SitecoreRandomString 64 -DisallowSpecial) - -# SITECORE_ID_CERTIFICATE -$idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial -Set-EnvFileVariable "SITECORE_ID_CERTIFICATE" -Value (Get-SitecoreCertificateAsBase64String -DnsName "localhost" -Password (ConvertTo-SecureString -String $idCertPassword -Force -AsPlainText)) - -# SITECORE_ID_CERTIFICATE_PASSWORD -Set-EnvFileVariable "SITECORE_ID_CERTIFICATE_PASSWORD" -Value $idCertPassword - ################################## # Configure TLS/HTTPS certificates ################################## @@ -107,23 +95,89 @@ try { Write-Host "Generating Traefik TLS certificate..." -ForegroundColor Green & $mkcert -install & $mkcert "*.$($HostName).localhost" + + # stash CAROOT path for messaging at the end of the script + $caRoot = "$(& $mkcert -CAROOT)\rootCA.pem" } catch { - Write-Host "An error occurred while attempting to generate TLS certificate: $_" -ForegroundColor Red + Write-Error "An error occurred while attempting to generate TLS certificate: $_" } finally { Pop-Location } + ################################ # Add Windows hosts file entries ################################ Write-Host "Adding Windows hosts file entries..." -ForegroundColor Green -Add-HostsEntry "cd.$($HostName).localhost" Add-HostsEntry "cm.$($HostName).localhost" +if ($Topology -ne "xp0") { + Add-HostsEntry "cd.$($HostName).localhost" +} Add-HostsEntry "id.$($HostName).localhost" Add-HostsEntry "www.$($HostName).localhost" -Write-Host "Done!" -ForegroundColor Green \ No newline at end of file + +############################### +# Populate the environment file +############################### + +if ($InitEnv) { + Push-Location $workinDirectoryPath +} + + Write-Host "Populating required .env file values..." -ForegroundColor Green + + # HOST_LICENSE_FOLDER + Set-EnvFileVariable "HOST_LICENSE_FOLDER" -Value $LicenseXmlPath + + # CM_HOST + Set-EnvFileVariable "CM_HOST" -Value "cm.$($HostName).localhost" + + if ($Topology -ne "xp0") { + # CD_HOST + Set-EnvFileVariable "CD_HOST" -Value "cd.$($HostName).localhost" + } + + # ID_HOST + Set-EnvFileVariable "ID_HOST" -Value "id.$($HostName).localhost" + + # SITE_HOST + Set-EnvFileVariable "SITE_HOST" -Value "www.$($HostName).localhost" + + # TELERIK_ENCRYPTION_KEY = random 64-128 chars + Set-EnvFileVariable "TELERIK_ENCRYPTION_KEY" -Value (Get-SitecoreRandomString 128) + + # MEDIA_REQUEST_PROTECTION_SHARED_SECRET + Set-EnvFileVariable "MEDIA_REQUEST_PROTECTION_SHARED_SECRET" -Value (Get-SitecoreRandomString 64) + + # SITECORE_IDSECRET = random 64 chars + Set-EnvFileVariable "SITECORE_IDSECRET" -Value (Get-SitecoreRandomString 64 -DisallowSpecial) + + # SITECORE_ID_CERTIFICATE + $idCertPassword = Get-SitecoreRandomString 12 -DisallowSpecial + Set-EnvFileVariable "SITECORE_ID_CERTIFICATE" -Value (Get-SitecoreCertificateAsBase64String -DnsName "localhost" -Password (ConvertTo-SecureString -String $idCertPassword -Force -AsPlainText) -KeyLength 2048) + + # SITECORE_ID_CERTIFICATE_PASSWORD + Set-EnvFileVariable "SITECORE_ID_CERTIFICATE_PASSWORD" -Value $idCertPassword + + # SQL_SA_PASSWORD + # Need to ensure it meets SQL complexity requirements + Set-EnvFileVariable "SQL_SA_PASSWORD" -Value (Get-SitecoreRandomString 19 -DisallowSpecial -EnforceComplexity) + + # SQL_SERVER + Set-EnvFileVariable "SQL_SERVER" -Value "mssql" + + # SQL_SA_LOGIN + Set-EnvFileVariable "SQL_SA_LOGIN" -Value "sa" + + # SITECORE_ADMIN_PASSWORD + Set-EnvFileVariable "SITECORE_ADMIN_PASSWORD" -Value $AdminPassword + + # TOPOLOGY + Set-EnvFileVariable "TOPOLOGY" -Value $Topology + + Write-Host "Done!" -ForegroundColor Green \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xm1/.env b/examples/helix-basic-aspnetcore/run/sitecore-xm1/.env new file mode 100644 index 00000000..57c238c1 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xm1/.env @@ -0,0 +1,62 @@ +# If you intend to push to a private registry, fill that in here. +REGISTRY= +COMPOSE_PROJECT_NAME=basic-company-aspnetcore +VERSION= + +# Configure host names, which will be used to configure Traefik proxy routing. +CD_HOST=cd.basic-company-aspnetcore.localhost +CM_HOST=cm.basic-company-aspnetcore.localhost +ID_HOST=id.basic-company-aspnetcore.localhost +RENDERING_HOST=www.basic-company-aspnetcore.localhost + +# Sitecore Docker registry and platform version. +# The ltsc2019-based images are used by default here. Development-only 1909 images are also available. +SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ +SITECORE_VERSION=10.2.0-ltsc2019 + +# The sitecore\admin and SQL 'sa' account passwords for this environment are configurable here. +SITECORE_ADMIN_PASSWORD= +SQL_SERVER= +SQL_SA_LOGIN= +SQL_SA_PASSWORD= + +# Other supporting images, including Sitecore modules and Docker tools +SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/ +SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ +HEADLESS_SERVICES_VERSION=20.0.1-20H2 +MANAGEMENT_SERVICES_VERSION=4.2.1-20H2 +TOOLS_VERSION=10.2-1809 +TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 + +# MSBuild configuration and the target build stage for the Rendering Host image. +NETCORE_BUILD_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.1 +SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 +SOLUTION_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:1809 +BUILD_CONFIGURATION=debug + +# Prefix for Solr cores used with Sitecore Content Search +SOLR_CORE_PREFIX_NAME=sitecore + +# Mount paths for code deployment, data persistence, and your Sitecore license. +LOCAL_DEPLOY_PATH=..\..\docker\deploy\ +LOCAL_DATA_PATH=..\..\docker\data\ +HOST_LICENSE_FOLDER= + +# Because we are using a mounted license file, this value can be empty. +# Included here to suppress 'variable is not set' warning from docker-compose. +SITECORE_LICENSE= + +# The isolation mode for Sitecore containers. +# Compatibility of isolation mode depends on the Host and Container OS versions. +ISOLATION=default +TRAEFIK_ISOLATION=hyperv + +# Generated keys and certificates for your environment. +REPORTING_API_KEY= +SITECORE_IDSECRET= +TELERIK_ENCRYPTION_KEY= +SITECORE_ID_CERTIFICATE= +SITECORE_ID_CERTIFICATE_PASSWORD= +MEDIA_REQUEST_PROTECTION_SHARED_SECRET= + +TOPOLOGY= \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/docker-compose.override.yml b/examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.override.yml similarity index 66% rename from examples/helix-basic-aspnetcore/docker-compose.override.yml rename to examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.override.yml index 33372f77..c29a359d 100644 --- a/examples/helix-basic-aspnetcore/docker-compose.override.yml +++ b/examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.override.yml @@ -1,3 +1,11 @@ +# +# The docker-compose.yml in this solution is a stock Sitecore xm1 environment, without +# any changes. This override represents all the additions/changes needed for this solution. +# Note that some of the overrides point to 'empty' Dockerfiles. This is recommended, even if +# you are not customizing an image, to enable retagging and later customization. See Sitecore +# Containers documentation for details. +# + version: "2.4" services: @@ -5,7 +13,7 @@ services: dotnetsdk: image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} build: - context: ./docker/build/dotnetsdk + context: ../../docker/build/dotnetsdk args: BUILD_IMAGE: ${SOLUTION_BUILD_IMAGE} NETCORE_BUILD_IMAGE: ${NETCORE_BUILD_IMAGE} @@ -14,7 +22,8 @@ services: solution: image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} build: - context: . + context: ../../ + dockerfile: docker/build/solution/Dockerfile args: BASE_IMAGE: ${SOLUTION_BASE_IMAGE} BUILD_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} @@ -26,7 +35,7 @@ services: rendering: image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-rendering:${VERSION:-latest} build: - context: ./docker/build/rendering + context: ../../docker/build/rendering target: ${BUILD_CONFIGURATION} args: DEBUG_BASE_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} @@ -35,7 +44,7 @@ services: ports: - "8090:80" volumes: - - .\:C:\solution + - ..\..\:C:\solution environment: ASPNETCORE_ENVIRONMENT: "Development" ASPNETCORE_URLS: "http://*:80" @@ -52,27 +61,29 @@ services: traefik: volumes: - - ./docker/traefik:C:/etc/traefik + - ../../docker/traefik:C:/etc/traefik depends_on: - rendering redis: image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest} build: - context: ./docker/build/redis + context: ../../docker/build/redis args: BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} mssql: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-mssql:${VERSION:-latest} - build: - context: ./docker/build/mssql - args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION} - HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION} mem_limit: 2GB volumes: - ${LOCAL_DATA_PATH}\mssql:c:\data + + mssql-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-mssql-init:${VERSION:-latest} + build: + context: ../../docker/build/mssql-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql-init:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} # Mount our Solr data folder. solr: @@ -82,30 +93,30 @@ services: # Mount our Solr data folder and use our retagged Solr image. # Some modules (like SXA) also require additions to the Solr image. solr-init: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-solr-init:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-solr-init:${VERSION:-latest} build: - context: ./docker/build/solr-init + context: ../../docker/build/solr-init args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} id: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id6:${VERSION:-latest} build: - context: ./docker/build/id + context: ../../docker/build/id args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} volumes: - ${HOST_LICENSE_FOLDER}:C:\license environment: SITECORE_LICENSE_LOCATION: C:\license\license.xml cd: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-cd:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cd:${VERSION:-latest} build: - context: ./docker/build/cd + context: ../../docker/build/cd args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cd:${SITECORE_VERSION} - HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cd:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} depends_on: @@ -121,13 +132,13 @@ services: entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1" cm: - image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-cm:${VERSION:-latest} + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cm:${VERSION:-latest} build: - context: ./docker/build/cm + context: ../../docker/build/cm args: - BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cm:${SITECORE_VERSION} - HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xm1-assets:${HEADLESS_SERVICES_VERSION} - MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-xm1-assets:${MANAGEMENT_SERVICES_VERSION} + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} + MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-${TOPOLOGY}-assets:${MANAGEMENT_SERVICES_VERSION} TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} depends_on: diff --git a/examples/helix-basic-aspnetcore/docker-compose.yml b/examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.yml similarity index 63% rename from examples/helix-basic-aspnetcore/docker-compose.yml rename to examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.yml index 552cc17a..bc7ae718 100644 --- a/examples/helix-basic-aspnetcore/docker-compose.yml +++ b/examples/helix-basic-aspnetcore/run/sitecore-xm1/docker-compose.yml @@ -1,4 +1,3 @@ -version: "2.4" services: traefik: isolation: ${TRAEFIK_ISOLATION} @@ -10,6 +9,7 @@ services: - "--providers.docker.exposedByDefault=false" - "--providers.file.directory=C:/etc/traefik/config/dynamic" - "--entryPoints.websecure.address=:443" + - "--entryPoints.websecure.forwardedHeaders.insecure" ports: - "443:443" - "8079:8080" @@ -32,10 +32,9 @@ services: image: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} mssql: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} environment: SA_PASSWORD: ${SQL_SA_PASSWORD} - SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} ACCEPT_EULA: "Y" ports: - "14330:1433" @@ -43,9 +42,25 @@ services: - type: bind source: .\mssql-data target: c:\data + mssql-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql-init:${SITECORE_VERSION} + environment: + SQL_SERVER: ${SQL_SERVER} + SQL_ADMIN_LOGIN: ${SQL_SA_LOGIN} + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} + POST_DEPLOYMENT_WAIT_PERIOD: 300 + healthcheck: + test: ["CMD", "powershell", "-command", "if ([System.Environment]::GetEnvironmentVariable('DatabasesDeploymentStatus', 'Machine') -eq 'Complete') { exit 0 } else { exit 1}"] + start_period: 300s + interval: 5s + depends_on: + mssql: + condition: service_healthy solr: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.4.0-${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.8.2-${SITECORE_VERSION} ports: - "8984:8983" volumes: @@ -54,9 +69,11 @@ services: target: c:\data environment: SOLR_MODE: solrcloud + healthcheck: + test: ["CMD", "powershell", "-command", "try { $$statusCode = (iwr http://solr:8983/solr/admin/cores?action=STATUS -UseBasicParsing).StatusCode; if ($$statusCode -eq 200) { exit 0 } else { exit 1} } catch { exit 1 }"] solr-init: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} environment: SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} @@ -65,9 +82,9 @@ services: condition: service_healthy id: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} environment: - Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD} + Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST}/sitecore/login?rc=1 Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1: ${SITECORE_IDSECRET} Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${CM_HOST} @@ -76,10 +93,10 @@ services: Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} Sitecore_License: ${SITECORE_LICENSE} healthcheck: - test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] timeout: 300s depends_on: - mssql: + mssql-init: condition: service_healthy labels: - "traefik.enable=true" @@ -88,9 +105,9 @@ services: - "traefik.http.routers.id-secure.tls=true" cd: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cd:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cd:${SITECORE_VERSION} depends_on: - mssql: + mssql-init: condition: service_healthy solr-init: condition: service_started @@ -98,9 +115,9 @@ services: condition: service_started environment: Sitecore_AppSettings_instanceNameMode:define: default - Sitecore_ConnectionStrings_Security: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_Web: Data Source=mssql;Initial Catalog=Sitecore.Web;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_ExperienceForms: Data Source=mssql;Initial Catalog=Sitecore.ExperienceForms;User ID=sa;Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true Sitecore_ConnectionStrings_Redis.Sessions: redis:6379,ssl=False,abortConnect=False Sitecore_License: ${SITECORE_LICENSE} @@ -111,14 +128,17 @@ services: timeout: 300s labels: - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" - "traefik.http.routers.cd-secure.entrypoints=websecure" - "traefik.http.routers.cd-secure.rule=Host(`${CD_HOST}`)" - "traefik.http.routers.cd-secure.tls=true" + - "traefik.http.routers.cd-secure.middlewares=force-STS-Header" cm: isolation: ${ISOLATION} - image: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cm:${SITECORE_VERSION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} depends_on: - mssql: + mssql-init: condition: service_healthy solr-init: condition: service_started @@ -126,11 +146,11 @@ services: condition: service_started environment: Sitecore_AppSettings_instanceNameMode:define: default - Sitecore_ConnectionStrings_Core: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_Security: Data Source=mssql;Initial Catalog=Sitecore.Core;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_Master: Data Source=mssql;Initial Catalog=Sitecore.Master;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_Web: Data Source=mssql;Initial Catalog=Sitecore.Web;User ID=sa;Password=${SQL_SA_PASSWORD} - Sitecore_ConnectionStrings_ExperienceForms: Data Source=mssql;Initial Catalog=Sitecore.ExperienceForms;User ID=sa;Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true Sitecore_ConnectionStrings_Sitecoreidentity.secret: ${SITECORE_IDSECRET} Sitecore_AppSettings_Telerik.AsyncUpload.ConfigurationEncryptionKey: ${TELERIK_ENCRYPTION_KEY} diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp0/.env b/examples/helix-basic-aspnetcore/run/sitecore-xp0/.env new file mode 100644 index 00000000..57c238c1 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp0/.env @@ -0,0 +1,62 @@ +# If you intend to push to a private registry, fill that in here. +REGISTRY= +COMPOSE_PROJECT_NAME=basic-company-aspnetcore +VERSION= + +# Configure host names, which will be used to configure Traefik proxy routing. +CD_HOST=cd.basic-company-aspnetcore.localhost +CM_HOST=cm.basic-company-aspnetcore.localhost +ID_HOST=id.basic-company-aspnetcore.localhost +RENDERING_HOST=www.basic-company-aspnetcore.localhost + +# Sitecore Docker registry and platform version. +# The ltsc2019-based images are used by default here. Development-only 1909 images are also available. +SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ +SITECORE_VERSION=10.2.0-ltsc2019 + +# The sitecore\admin and SQL 'sa' account passwords for this environment are configurable here. +SITECORE_ADMIN_PASSWORD= +SQL_SERVER= +SQL_SA_LOGIN= +SQL_SA_PASSWORD= + +# Other supporting images, including Sitecore modules and Docker tools +SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/ +SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ +HEADLESS_SERVICES_VERSION=20.0.1-20H2 +MANAGEMENT_SERVICES_VERSION=4.2.1-20H2 +TOOLS_VERSION=10.2-1809 +TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 + +# MSBuild configuration and the target build stage for the Rendering Host image. +NETCORE_BUILD_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.1 +SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 +SOLUTION_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:1809 +BUILD_CONFIGURATION=debug + +# Prefix for Solr cores used with Sitecore Content Search +SOLR_CORE_PREFIX_NAME=sitecore + +# Mount paths for code deployment, data persistence, and your Sitecore license. +LOCAL_DEPLOY_PATH=..\..\docker\deploy\ +LOCAL_DATA_PATH=..\..\docker\data\ +HOST_LICENSE_FOLDER= + +# Because we are using a mounted license file, this value can be empty. +# Included here to suppress 'variable is not set' warning from docker-compose. +SITECORE_LICENSE= + +# The isolation mode for Sitecore containers. +# Compatibility of isolation mode depends on the Host and Container OS versions. +ISOLATION=default +TRAEFIK_ISOLATION=hyperv + +# Generated keys and certificates for your environment. +REPORTING_API_KEY= +SITECORE_IDSECRET= +TELERIK_ENCRYPTION_KEY= +SITECORE_ID_CERTIFICATE= +SITECORE_ID_CERTIFICATE_PASSWORD= +MEDIA_REQUEST_PROTECTION_SHARED_SECRET= + +TOPOLOGY= \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.override.yml b/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.override.yml new file mode 100644 index 00000000..6ea4a364 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.override.yml @@ -0,0 +1,188 @@ +# +# The docker-compose.yml in this solution is a stock Sitecore xp0 environment, without +# any changes. This override represents all the additions/changes needed for this solution. +# Note that some of the overrides point to 'empty' Dockerfiles. This is recommended, even if +# you are not customizing an image, to enable retagging and later customization. See Sitecore +# Containers documentation for details. +# + +version: "2.4" + +services: + + dotnetsdk: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + build: + context: ../../docker/build/dotnetsdk + args: + BUILD_IMAGE: ${SOLUTION_BUILD_IMAGE} + NETCORE_BUILD_IMAGE: ${NETCORE_BUILD_IMAGE} + scale: 0 + + solution: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + build: + context: ../../ + dockerfile: docker/build/solution/Dockerfile + args: + BASE_IMAGE: ${SOLUTION_BASE_IMAGE} + BUILD_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION} + depends_on: + - dotnetsdk + scale: 0 + + rendering: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-rendering:${VERSION:-latest} + build: + context: ../../docker/build/rendering + target: ${BUILD_CONFIGURATION} + args: + DEBUG_BASE_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + RELEASE_BASE_IMAGE: mcr.microsoft.com/dotnet/core/aspnet:3.1 + SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + ports: + - "8090:80" + volumes: + - ..\..\:C:\solution + environment: + ASPNETCORE_ENVIRONMENT: "Development" + ASPNETCORE_URLS: "http://*:80" + Sitecore__InstanceUri: "http://cm" + Sitecore__EnableExperienceEditor: "true" + depends_on: + - cm + - solution + labels: + - "traefik.enable=true" + - "traefik.http.routers.rendering-secure.entrypoints=websecure" + - "traefik.http.routers.rendering-secure.rule=Host(`${RENDERING_HOST}`)" + - "traefik.http.routers.rendering-secure.tls=true" + + traefik: + volumes: + - ../../docker/traefik:C:/etc/traefik + depends_on: + - rendering + + redis: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest} + build: + context: ../../docker/build/redis + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} + + mssql: + mem_limit: 2GB + volumes: + - ${LOCAL_DATA_PATH}\mssql:c:\data + + mssql-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-mssql-init:${VERSION:-latest} + build: + context: ../../docker/build/mssql-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql-init:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xp1-assets:${HEADLESS_SERVICES_VERSION} + + # Mount our Solr data folder. + solr: + volumes: + - ${LOCAL_DATA_PATH}\solr:c:\data + + # Mount our Solr data folder and use our retagged Solr image. + # Some modules (like SXA) also require additions to the Solr image. + solr-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-solr-init:${VERSION:-latest} + build: + context: ../../docker/build/solr-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} + + id: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id6:${VERSION:-latest} + build: + context: ../../docker/build/id + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:C:\license + environment: + SITECORE_LICENSE_LOCATION: C:\license\license.xml + + cm: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cm:${VERSION:-latest} + build: + context: ../../docker/build/cm + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-xp1-assets:${HEADLESS_SERVICES_VERSION} + MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-xp1-assets:${MANAGEMENT_SERVICES_VERSION} + TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} + SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + depends_on: + - solution + volumes: + - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy + - ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs + - ${HOST_LICENSE_FOLDER}:C:\license + environment: + SITECORE_LICENSE_LOCATION: C:\license\license.xml + RENDERING_HOST_PUBLIC_URI: "https://${RENDERING_HOST}" + ## Development Environment Optimizations + SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff + Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM + entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1" + +# Use our retagged XConnect image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: XConnect roles expect a folder with license.xml, not the file itself. + xconnect: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xconnect:${VERSION:-latest} + build: + context: ../../docker/build/xconnect + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xconnect:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged XConnect Search Indexer image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + xdbsearchworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbsearchworker:${VERSION:-latest} + build: + context: ../../docker/build/xdbsearchworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearchworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged Marketing Automation Engine image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + xdbautomationworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbautomationworker:${VERSION:-latest} + build: + context: ../../docker/build/xdbautomationworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged Cortex Processing Engine image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + cortexprocessingworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cortexprocessingworker:${VERSION:-latest} + build: + context: ../../docker/build/cortexprocessingworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessingworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.yml b/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.yml new file mode 100644 index 00000000..aff64e25 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp0/docker-compose.yml @@ -0,0 +1,226 @@ +services: + traefik: + isolation: ${TRAEFIK_ISOLATION} + image: ${TRAEFIK_IMAGE} + command: + - "--ping" + - "--api.insecure=true" + - "--providers.docker.endpoint=npipe:////./pipe/docker_engine" + - "--providers.docker.exposedByDefault=false" + - "--providers.file.directory=C:/etc/traefik/config/dynamic" + - "--entryPoints.websecure.address=:443" + - "--entryPoints.websecure.forwardedHeaders.insecure" + ports: + - "443:443" + - "8079:8080" + healthcheck: + test: ["CMD", "traefik", "healthcheck", "--ping"] + volumes: + - source: \\.\pipe\docker_engine + target: \\.\pipe\docker_engine + type: npipe + - ./traefik:C:/etc/traefik + depends_on: + id: + condition: service_healthy + cm: + condition: service_healthy + mssql: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} + environment: + SA_PASSWORD: ${SQL_SA_PASSWORD} + ACCEPT_EULA: "Y" + ports: + - "14330:1433" + volumes: + - type: bind + source: .\mssql-data + target: c:\data + mssql-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql-init:${SITECORE_VERSION} + environment: + SQL_SERVER: ${SQL_SERVER} + SQL_ADMIN_LOGIN: ${SQL_SA_LOGIN} + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} + POST_DEPLOYMENT_WAIT_PERIOD: 300 + healthcheck: + test: ["CMD", "powershell", "-command", "if ([System.Environment]::GetEnvironmentVariable('DatabasesDeploymentStatus', 'Machine') -eq 'Complete') { exit 0 } else { exit 1}"] + start_period: 300s + interval: 5s + depends_on: + mssql: + condition: service_healthy + solr: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.8.2-${SITECORE_VERSION} + ports: + - "8984:8983" + volumes: + - type: bind + source: .\solr-data + target: c:\data + environment: + SOLR_MODE: solrcloud + healthcheck: + test: ["CMD", "powershell", "-command", "try { $$statusCode = (iwr http://solr:8983/solr/admin/cores?action=STATUS -UseBasicParsing).StatusCode; if ($$statusCode -eq 200) { exit 0 } else { exit 1} } catch { exit 1 }"] + solr-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} + environment: + SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} + depends_on: + solr: + condition: service_healthy + id: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} + environment: + Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST}/sitecore/login?rc=1 + Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1: ${SITECORE_IDSECRET} + Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${CM_HOST} + Sitecore_Sitecore__IdentityServer__CertificateRawData: ${SITECORE_ID_CERTIFICATE} + Sitecore_Sitecore__IdentityServer__PublicOrigin: https://${ID_HOST} + Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + depends_on: + mssql-init: + condition: service_healthy + labels: + - "traefik.enable=true" + - "traefik.http.routers.id-secure.entrypoints=websecure" + - "traefik.http.routers.id-secure.rule=Host(`${ID_HOST}`)" + - "traefik.http.routers.id-secure.tls=true" + cm: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} + depends_on: + id: + condition: service_started + xconnect: + condition: service_started + environment: + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Exm.Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Exm.master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Sitecore.Reporting.Client: http://xconnect + Sitecore_ConnectionStrings_Cortex.Processing.Engine: http://xconnect + Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true + Sitecore_ConnectionStrings_SitecoreIdentity.Secret: ${SITECORE_IDSECRET} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client: http://xconnect + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client: http://xconnect + Sitecore_ConnectionStrings_Xdb.ReferenceData.Client: http://xconnect + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Identity_Server_Authority: https://${ID_HOST} + Sitecore_Identity_Server_InternalAuthority: http://id + Sitecore_Identity_Server_CallbackAuthority: https://${CM_HOST} + Sitecore_Identity_Server_Require_Https: "false" + Sitecore_Analytics_Forwarded_Request_Http_Header: X-Forwarded-For + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" + - "traefik.http.routers.cm-secure.entrypoints=websecure" + - "traefik.http.routers.cm-secure.rule=Host(`${CM_HOST}`)" + - "traefik.http.routers.cm-secure.tls=true" + - "traefik.http.routers.cm-secure.middlewares=force-STS-Header" + xconnect: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xconnect:${SITECORE_VERSION} + ports: + - "8081:80" + depends_on: + mssql-init: + condition: service_healthy + solr-init: + condition: service_started + environment: + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME}_xdb;solrCloud=true + Sitecore_Sitecore:XConnect:CollectionSearch:Services:Solr.SolrReaderSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: 'false' + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbsearchworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearchworker:${SITECORE_VERSION} + depends_on: + xconnect: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME}_xdb;solrCloud=true + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: 'false' + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s + xdbautomationworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationworker:${SITECORE_VERSION} + depends_on: + xconnect: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s + cortexprocessingworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessingworker:${SITECORE_VERSION} + depends_on: + xconnect: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xconnect + Sitecore_ConnectionStrings_XConnect.Configuration: http://xconnect + Sitecore_ConnectionStrings_XConnect.Search: http://xconnect + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp0/readme.md b/examples/helix-basic-aspnetcore/run/sitecore-xp0/readme.md new file mode 100644 index 00000000..48dc912b --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp0/readme.md @@ -0,0 +1,3 @@ +## Note + +You will notice that there are some images which are referenced from xp1 because no image for xp0. So, this is done intentionally. diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp1/.env b/examples/helix-basic-aspnetcore/run/sitecore-xp1/.env new file mode 100644 index 00000000..57c238c1 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp1/.env @@ -0,0 +1,62 @@ +# If you intend to push to a private registry, fill that in here. +REGISTRY= +COMPOSE_PROJECT_NAME=basic-company-aspnetcore +VERSION= + +# Configure host names, which will be used to configure Traefik proxy routing. +CD_HOST=cd.basic-company-aspnetcore.localhost +CM_HOST=cm.basic-company-aspnetcore.localhost +ID_HOST=id.basic-company-aspnetcore.localhost +RENDERING_HOST=www.basic-company-aspnetcore.localhost + +# Sitecore Docker registry and platform version. +# The ltsc2019-based images are used by default here. Development-only 1909 images are also available. +SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/ +SITECORE_VERSION=10.2.0-ltsc2019 + +# The sitecore\admin and SQL 'sa' account passwords for this environment are configurable here. +SITECORE_ADMIN_PASSWORD= +SQL_SERVER= +SQL_SA_LOGIN= +SQL_SA_PASSWORD= + +# Other supporting images, including Sitecore modules and Docker tools +SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/ +SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/ +HEADLESS_SERVICES_VERSION=20.0.1-20H2 +MANAGEMENT_SERVICES_VERSION=4.2.1-20H2 +TOOLS_VERSION=10.2-1809 +TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809 + +# MSBuild configuration and the target build stage for the Rendering Host image. +NETCORE_BUILD_IMAGE=mcr.microsoft.com/dotnet/core/sdk:3.1 +SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019 +SOLUTION_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:1809 +BUILD_CONFIGURATION=debug + +# Prefix for Solr cores used with Sitecore Content Search +SOLR_CORE_PREFIX_NAME=sitecore + +# Mount paths for code deployment, data persistence, and your Sitecore license. +LOCAL_DEPLOY_PATH=..\..\docker\deploy\ +LOCAL_DATA_PATH=..\..\docker\data\ +HOST_LICENSE_FOLDER= + +# Because we are using a mounted license file, this value can be empty. +# Included here to suppress 'variable is not set' warning from docker-compose. +SITECORE_LICENSE= + +# The isolation mode for Sitecore containers. +# Compatibility of isolation mode depends on the Host and Container OS versions. +ISOLATION=default +TRAEFIK_ISOLATION=hyperv + +# Generated keys and certificates for your environment. +REPORTING_API_KEY= +SITECORE_IDSECRET= +TELERIK_ENCRYPTION_KEY= +SITECORE_ID_CERTIFICATE= +SITECORE_ID_CERTIFICATE_PASSWORD= +MEDIA_REQUEST_PROTECTION_SHARED_SECRET= + +TOPOLOGY= \ No newline at end of file diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.override.yml b/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.override.yml new file mode 100644 index 00000000..bc9cb2c6 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.override.yml @@ -0,0 +1,307 @@ +# +# The docker-compose.yml in this solution is a stock Sitecore xp1 environment, without +# any changes. This override represents all the additions/changes needed for this solution. +# Note that some of the overrides point to 'empty' Dockerfiles. This is recommended, even if +# you are not customizing an image, to enable retagging and later customization. See Sitecore +# Containers documentation for details. +# + +version: "2.4" + +services: + + dotnetsdk: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + build: + context: ../../docker/build/dotnetsdk + args: + BUILD_IMAGE: ${SOLUTION_BUILD_IMAGE} + NETCORE_BUILD_IMAGE: ${NETCORE_BUILD_IMAGE} + scale: 0 + + solution: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + build: + context: ../../ + dockerfile: docker/build/solution/Dockerfile + args: + BASE_IMAGE: ${SOLUTION_BASE_IMAGE} + BUILD_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + BUILD_CONFIGURATION: ${BUILD_CONFIGURATION} + depends_on: + - dotnetsdk + scale: 0 + + rendering: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-rendering:${VERSION:-latest} + build: + context: ../../docker/build/rendering + target: ${BUILD_CONFIGURATION} + args: + DEBUG_BASE_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-dotnetsdk:${VERSION:-latest} + RELEASE_BASE_IMAGE: mcr.microsoft.com/dotnet/core/aspnet:3.1 + SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + ports: + - "8090:80" + volumes: + - ..\..\:C:\solution + environment: + ASPNETCORE_ENVIRONMENT: "Development" + ASPNETCORE_URLS: "http://*:80" + Sitecore__InstanceUri: "http://cd" + Sitecore__EnableExperienceEditor: "true" + depends_on: + - cd + - solution + labels: + - "traefik.enable=true" + - "traefik.http.routers.rendering-secure.entrypoints=websecure" + - "traefik.http.routers.rendering-secure.rule=Host(`${RENDERING_HOST}`)" + - "traefik.http.routers.rendering-secure.tls=true" + + traefik: + volumes: + - ../../docker/traefik:C:/etc/traefik + depends_on: + - rendering + + redis: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest} + build: + context: ../../docker/build/redis + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} + + mssql: + mem_limit: 2GB + volumes: + - ${LOCAL_DATA_PATH}\mssql:c:\data + + mssql-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-mssql-init:${VERSION:-latest} + build: + context: ../../docker/build/mssql-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql-init:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} + + # Mount our Solr data folder. + solr: + volumes: + - ${LOCAL_DATA_PATH}\solr:c:\data + + # Mount our Solr data folder and use our retagged Solr image. + # Some modules (like SXA) also require additions to the Solr image. + solr-init: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-solr-init:${VERSION:-latest} + build: + context: ../../docker/build/solr-init + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} + + id: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id6:${VERSION:-latest} + build: + context: ../../docker/build/id + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:C:\license + environment: + SITECORE_LICENSE_LOCATION: C:\license\license.xml + + cd: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cd:${VERSION:-latest} + build: + context: ../../docker/build/cd + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cd:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} + TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} + SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + depends_on: + - solution + volumes: + - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy + - ${LOCAL_DATA_PATH}\cd:C:\inetpub\wwwroot\App_Data\logs + - ${HOST_LICENSE_FOLDER}:C:\license + environment: + SITECORE_LICENSE_LOCATION: C:\license\license.xml + ## Development Environment Optimizations + SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff + entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1" + + cm: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cm:${VERSION:-latest} + build: + context: ../../docker/build/cm + args: + BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} + HEADLESS_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-headless-services-${TOPOLOGY}-assets:${HEADLESS_SERVICES_VERSION} + MANAGEMENT_SERVICES_IMAGE: ${SITECORE_MODULE_REGISTRY}sitecore-management-services-${TOPOLOGY}-assets:${MANAGEMENT_SERVICES_VERSION} + TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION} + SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest} + depends_on: + - solution + volumes: + - ${LOCAL_DEPLOY_PATH}\platform:C:\deploy + - ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs + - ${HOST_LICENSE_FOLDER}:C:\license + environment: + SITECORE_LICENSE_LOCATION: C:\license\license.xml + RENDERING_HOST_PUBLIC_URI: "https://${RENDERING_HOST}" + ## Development Environment Optimizations + SITECORE_DEVELOPMENT_PATCHES: DevEnvOn,CustomErrorsOff,DebugOn,DiagnosticsOff,InitMessagesOff + Sitecore_AppSettings_exmEnabled:define: "no" # remove to turn on EXM + entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1" + +# Use our retagged Prc image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: Prc roles expect a folder with license.xml, not the file itself. + prc: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-prc:${VERSION:-latest} + build: + context: ../../docker/build/prc + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-prc:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\license.xml + + # Use our retagged xdbcollection image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: xdbcollection roles expect a folder with license.xml, not the file itself. + xdbcollection: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbcollection:${VERSION:-latest} + build: + context: ../../docker/build/xdbcollection + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbcollection:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged xdbsearch image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: xdbsearch roles expect a folder with license.xml, not the file itself. + xdbsearch: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbsearch:${VERSION:-latest} + build: + context: ../../docker/build/xdbsearch + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearch:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged xdbautomation image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: xdbautomation roles expect a folder with license.xml, not the file itself. + xdbautomation: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbautomation:${VERSION:-latest} + build: + context: ../../docker/build/xdbautomation + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomation:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged xdbautomationrpt image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: xdbautomationrpt roles expect a folder with license.xml, not the file itself. + xdbautomationrpt: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbautomationrpt:${VERSION:-latest} + build: + context: ../../docker/build/xdbautomationrpt + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationrpt:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged cortexprocessing image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: cortexprocessing roles expect a folder with license.xml, not the file itself. + cortexprocessing: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cortexprocessing:${VERSION:-latest} + build: + context: ../../docker/build/cortexprocessing + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessing:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged cortexreporting image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: cortexreporting roles expect a folder with license.xml, not the file itself. + cortexreporting: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cortexreporting:${VERSION:-latest} + build: + context: ../../docker/build/cortexreporting + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexreporting:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged xdbrefdata image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + # Note: xdbrefdata roles expect a folder with license.xml, not the file itself. + xdbrefdata: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbrefdata:${VERSION:-latest} + build: + context: ../../docker/build/xdbrefdata + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbrefdata:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged XConnect Search Indexer image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + xdbsearchworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbsearchworker:${VERSION:-latest} + build: + context: ../../docker/build/xdbsearchworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearchworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged Marketing Automation Engine image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + xdbautomationworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-xdbautomationworker:${VERSION:-latest} + build: + context: ../../docker/build/xdbautomationworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ + + # Use our retagged Cortex Processing Engine image. + # Configure for a mounted license folder instead of using SITECORE_LICENSE. + cortexprocessingworker: + image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-${TOPOLOGY}-cortexprocessingworker:${VERSION:-latest} + build: + context: ../../docker/build/cortexprocessingworker + args: + PARENT_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessingworker:${SITECORE_VERSION} + volumes: + - ${HOST_LICENSE_FOLDER}:c:\license + environment: + SITECORE_LICENSE_LOCATION: c:\license\ diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.yml b/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.yml new file mode 100644 index 00000000..68836812 --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp1/docker-compose.yml @@ -0,0 +1,399 @@ +services: + traefik: + isolation: ${TRAEFIK_ISOLATION} + image: ${TRAEFIK_IMAGE} + command: + - "--ping" + - "--api.insecure=true" + - "--providers.docker.endpoint=npipe:////./pipe/docker_engine" + - "--providers.docker.exposedByDefault=false" + - "--providers.file.directory=C:/etc/traefik/config/dynamic" + - "--entryPoints.websecure.address=:443" + - "--entryPoints.websecure.forwardedHeaders.insecure" + ports: + - "443:443" + - "8079:8080" + healthcheck: + test: ["CMD", "traefik", "healthcheck", "--ping"] + volumes: + - source: \\.\pipe\docker_engine + target: \\.\pipe\docker_engine + type: npipe + - ./traefik:C:/etc/traefik + depends_on: + id: + condition: service_healthy + cd: + condition: service_healthy + cm: + condition: service_healthy + redis: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-redis:${SITECORE_VERSION} + mssql: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/mssql-developer:2017-${SITECORE_VERSION} + environment: + SA_PASSWORD: ${SQL_SA_PASSWORD} + ACCEPT_EULA: "Y" + ports: + - "14330:1433" + volumes: + - type: bind + source: .\mssql-data + target: c:\data + mssql-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-mssql-init:${SITECORE_VERSION} + environment: + SQL_SERVER: ${SQL_SERVER} + SQL_ADMIN_LOGIN: ${SQL_SA_LOGIN} + SQL_ADMIN_PASSWORD: ${SQL_SA_PASSWORD} + SITECORE_ADMIN_PASSWORD: ${SITECORE_ADMIN_PASSWORD} + POST_DEPLOYMENT_WAIT_PERIOD: 300 + healthcheck: + test: ["CMD", "powershell", "-command", "if ([System.Environment]::GetEnvironmentVariable('DatabasesDeploymentStatus', 'Machine') -eq 'Complete') { exit 0 } else { exit 1}"] + start_period: 300s + interval: 5s + depends_on: + mssql: + condition: service_healthy + solr: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}nonproduction/solr:8.8.2-${SITECORE_VERSION} + ports: + - "8984:8983" + volumes: + - type: bind + source: .\solr-data + target: c:\data + environment: + SOLR_MODE: solrcloud + healthcheck: + test: ["CMD", "powershell", "-command", "try { $$statusCode = (iwr http://solr:8983/solr/admin/cores?action=STATUS -UseBasicParsing).StatusCode; if ($$statusCode -eq 200) { exit 0 } else { exit 1} } catch { exit 1 }"] + solr-init: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-solr-init:${SITECORE_VERSION} + environment: + SITECORE_SOLR_CONNECTION_STRING: http://solr:8983/solr + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} + depends_on: + solr: + condition: service_healthy + id: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-id6:${SITECORE_VERSION} + environment: + Sitecore_Sitecore__IdentityServer__SitecoreMemberShipOptions__ConnectionString: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_Sitecore__IdentityServer__AccountOptions__PasswordRecoveryUrl: https://${CM_HOST}/sitecore/login?rc=1 + Sitecore_Sitecore__IdentityServer__Clients__PasswordClient__ClientSecrets__ClientSecret1: ${SITECORE_IDSECRET} + Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup1: https://${CM_HOST} + Sitecore_Sitecore__IdentityServer__CertificateRawData: ${SITECORE_ID_CERTIFICATE} + Sitecore_Sitecore__IdentityServer__PublicOrigin: https://${ID_HOST} + Sitecore_Sitecore__IdentityServer__CertificateRawDataPassword: ${SITECORE_ID_CERTIFICATE_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "pwsh", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + depends_on: + mssql-init: + condition: service_healthy + labels: + - "traefik.enable=true" + - "traefik.http.routers.id-secure.entrypoints=websecure" + - "traefik.http.routers.id-secure.rule=Host(`${ID_HOST}`)" + - "traefik.http.routers.id-secure.tls=true" + cd: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cd:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + redis: + condition: service_started + xdbcollection: + condition: service_started + xdbautomation: + condition: service_started + xdbautomationrpt: + condition: service_started + xdbrefdata: + condition: service_started + environment: + Sitecore_AppSettings_instanceNameMode:define: default + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Exm.Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Exm.master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client: http://xdbautomation + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client: http://xdbautomationrpt + Sitecore_ConnectionStrings_Xdb.ReferenceData.Client: http://xdbrefdata + Sitecore_ConnectionStrings_Redis.Sessions: redis:6379,ssl=False,abortConnect=False + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Analytics_Forwarded_Request_Http_Header: X-Forwarded-For + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" + - "traefik.http.routers.cd-secure.entrypoints=websecure" + - "traefik.http.routers.cd-secure.rule=Host(`${CD_HOST}`)" + - "traefik.http.routers.cd-secure.tls=true" + - "traefik.http.routers.cd-secure.middlewares=force-STS-Header" + cm: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cm:${SITECORE_VERSION} + depends_on: + id: + condition: service_started + cortexreporting: + condition: service_started + cortexprocessing: + condition: service_started + xdbcollection: + condition: service_started + xdbsearch: + condition: service_started + xdbautomation: + condition: service_started + xdbautomationrpt: + condition: service_started + xdbrefdata: + condition: service_started + environment: + Sitecore_AppSettings_instanceNameMode:define: default + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Web: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Web;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting.ApiKey: ${REPORTING_API_KEY} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_ExperienceForms: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.ExperienceForms;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Exm.Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Exm.master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Sitecore.Reporting.Client: http://cortexreporting + Sitecore_ConnectionStrings_Cortex.Processing.Engine: http://cortexprocessing + Sitecore_ConnectionStrings_Solr.Search: http://solr:8983/solr;solrCloud=true + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_ConnectionStrings_XConnect.Search: http://xdbsearch + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Operations.Client: http://xdbautomation + Sitecore_ConnectionStrings_Xdb.MarketingAutomation.Reporting.Client: http://xdbautomationrpt + Sitecore_ConnectionStrings_Xdb.ReferenceData.Client: http://xdbrefdata + Sitecore_Processing_Service_Url: http://prc + Sitecore_Processing_Service_Require_Https: 'false' + Sitecore_AppSettings_Telerik.AsyncUpload.ConfigurationEncryptionKey: ${TELERIK_ENCRYPTION_KEY} + Sitecore_AppSettings_Telerik.Upload.ConfigurationHashKey: ${TELERIK_ENCRYPTION_KEY} + Sitecore_AppSettings_Telerik.Web.UI.DialogParametersEncryptionKey: ${TELERIK_ENCRYPTION_KEY} + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Identity_Server_Authority: https://${ID_HOST} + Sitecore_Identity_Server_InternalAuthority: http://id + Sitecore_Identity_Server_CallbackAuthority: https://${CM_HOST} + Sitecore_Identity_Server_Require_Https: "false" + SOLR_CORE_PREFIX_NAME: ${SOLR_CORE_PREFIX_NAME} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + labels: + - "traefik.enable=true" + - "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true" + - "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000" + - "traefik.http.routers.cm-secure.entrypoints=websecure" + - "traefik.http.routers.cm-secure.rule=Host(`${CM_HOST}`)" + - "traefik.http.routers.cm-secure.tls=true" + - "traefik.http.routers.cm-secure.middlewares=force-STS-Header" + prc: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-prc:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + xdbcollection: + condition: service_started + environment: + Sitecore_AppSettings_instanceNameMode:define: default + Sitecore_ConnectionStrings_Core: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Security: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Core;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Master: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Master;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting.ApiKey: ${REPORTING_API_KEY} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_License: ${SITECORE_LICENSE} + MEDIA_REQUEST_PROTECTION_SHARED_SECRET: ${MEDIA_REQUEST_PROTECTION_SHARED_SECRET} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbcollection: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbcollection:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + environment: + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbsearch: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearch:${SITECORE_VERSION} + depends_on: + xdbcollection: + condition: service_healthy + solr-init: + condition: service_started + environment: + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Processing.Pools: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.pools;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME}_xdb;solrCloud=true + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Sitecore:XConnect:CollectionSearch:Services:Solr.SolrReaderSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: 'false' + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbautomation: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomation:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + xdbcollection: + condition: service_started + xdbsearch: + condition: service_started + environment: + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_ConnectionStrings_XConnect.Search: http://xdbsearch + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbautomationrpt: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationrpt:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + environment: + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + cortexprocessing: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessing:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + environment: + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + cortexreporting: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexreporting:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + environment: + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbrefdata: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbrefdata:${SITECORE_VERSION} + depends_on: + mssql-init: + condition: service_healthy + environment: + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1"] + timeout: 300s + xdbsearchworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbsearchworker:${SITECORE_VERSION} + depends_on: + xdbsearch: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Collection: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Xdb.Collection.ShardMapManager;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_SolrCore: http://solr:8983/solr/${SOLR_CORE_PREFIX_NAME}_xdb;solrCloud=true + Sitecore_License: ${SITECORE_LICENSE} + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrReaderSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:SearchIndexer:Services:Solr.SolrWriterSettings:Options:RequireHttps: 'false' + Sitecore_Sitecore:XConnect:CollectionSearch:Services:XConnectSolrHealthCheckServicesConfiguration:Options:RequireHttps: 'false' + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s + xdbautomationworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-xdbautomationworker:${SITECORE_VERSION} + depends_on: + xdbcollection: + condition: service_healthy + xdbsearch: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_ConnectionStrings_XConnect.Search: http://xdbsearch + Sitecore_ConnectionStrings_Xdb.Marketingautomation: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Marketingautomation;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Xdb.Referencedata: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Referencedata;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Messaging: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Messaging;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s + cortexprocessingworker: + isolation: ${ISOLATION} + image: ${SITECORE_DOCKER_REGISTRY}sitecore-${TOPOLOGY}-cortexprocessingworker:${SITECORE_VERSION} + depends_on: + xdbcollection: + condition: service_healthy + xdbsearch: + condition: service_healthy + restart: unless-stopped + environment: + Sitecore_ConnectionStrings_Processing.Engine.Storage: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Storage;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_Processing.Engine.Tasks: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Processing.Engine.Tasks;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_ConnectionStrings_XConnect.Collection: http://xdbcollection + Sitecore_ConnectionStrings_XConnect.Configuration: http://xdbcollection + Sitecore_ConnectionStrings_XConnect.Search: http://xdbsearch + Sitecore_ConnectionStrings_Reporting: Data Source=${SQL_SERVER};Initial Catalog=Sitecore.Reporting;User ID=${SQL_SA_LOGIN};Password=${SQL_SA_PASSWORD} + Sitecore_License: ${SITECORE_LICENSE} + healthcheck: + test: ["CMD", "powershell", "-command", "C:/Healthchecks/Healthcheck.ps1 -Port 8080"] + timeout: 300s diff --git a/examples/helix-basic-aspnetcore/run/sitecore-xp1/readme.md b/examples/helix-basic-aspnetcore/run/sitecore-xp1/readme.md new file mode 100644 index 00000000..c5fdeaff --- /dev/null +++ b/examples/helix-basic-aspnetcore/run/sitecore-xp1/readme.md @@ -0,0 +1,28 @@ +# Issues in Execution in XP1 mode + +## Traefik container is unhealthy + +``` +ERROR: for traefik Container is unhealthy. +ERROR: Encountered errors while bringing up the project. +Waiting for CM to become available... +``` + +## Logs from xdbautomationworker container + +Getting below on xdbautomationworker container + +``` + +Starting Marketing Automation Engine... +Engine started. + +Press Ctrl+C or Ctrl+Break to exit +2022-10-01 12:32:03 ERR Health check "reference data sql" completed after 2402.0615ms with status Unhealthy and '"Error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"' +2022-10-01 12:32:03.445 +00:00 [Error] Health check "reference data sql" completed after 2402.0615ms with status Unhealthy and '"Error message: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"' + +``` + +## Thoughts + +I think so this is license issue (am using partner license) because same user and password are being used to connect other databases. diff --git a/examples/helix-basic-aspnetcore/up.ps1 b/examples/helix-basic-aspnetcore/up.ps1 index a2802c3c..03381097 100644 --- a/examples/helix-basic-aspnetcore/up.ps1 +++ b/examples/helix-basic-aspnetcore/up.ps1 @@ -1,11 +1,38 @@ -$ErrorActionPreference = "Stop"; +[CmdletBinding(DefaultParameterSetName = "no-arguments")] +Param ( + [Parameter(HelpMessage = "Alternative login using app client.", + ParameterSetName = "by-pass")] + [bool]$ByPass = $false, + + # use to run proper sitecore deployment setup + [Parameter(Mandatory = $true, + HelpMessage = "Sets the instance topology", + ParameterSetName = "env-init")] + [ValidateSet("xp0","xp1","xm1")] + [string]$Topology +) + +$topologyArray = "xp0", "xp1", "xm1"; +$ErrorActionPreference = "Stop"; +$startDirectory = ".\run\sitecore-"; +$workinDirectoryPath; +$envCheck; # Double check whether init has been run -$envCheckVariable = "HOST_LICENSE_FOLDER" -$envCheck = Get-Content .env -Encoding UTF8 | Where-Object { $_ -imatch "^$envCheckVariable=.+" } +$envCheckVariable = "HOST_LICENSE_FOLDER"; + +if ($topologyArray.Contains($Topology)) +{ + $envCheck = Get-Content (Join-Path -Path ($startDirectory + $Topology) -ChildPath .env) -Encoding UTF8 | Where-Object { $_ -imatch "^$envCheckVariable=.+" } + if ($envCheck) { + $workinDirectoryPath = $startDirectory + $Topology; + } +} + if (-not $envCheck) { - throw "$envCheckVariable does not have a value. Did you run 'init.ps1'?" + throw "$envCheckVariable does not have a value. Did you run 'init.ps1 -InitEnv'?" } +Push-Location $workinDirectoryPath # Build all containers in the Sitecore instance, forcing a pull of latest base containers Write-Host "Building containers..." -ForegroundColor Green @@ -18,6 +45,8 @@ if ($LASTEXITCODE -ne 0) { Write-Host "Starting Sitecore environment..." -ForegroundColor Green docker-compose up -d +Pop-Location + # Wait for Traefik to expose CM route Write-Host "Waiting for CM to become available..." -ForegroundColor Green $startTime = Get-Date @@ -40,7 +69,12 @@ Write-Host "Restoring Sitecore CLI..." -ForegroundColor Green dotnet tool restore Write-Host "Logging into Sitecore..." -ForegroundColor Green -dotnet sitecore login --cm https://cm.basic-company-aspnetcore.localhost/ --auth https://id.basic-company-aspnetcore.localhost/ --allow-write true +if ($ByPass) { + dotnet sitecore login --cm https://cm.basic-company-aspnetcore.localhost/ --auth https://id.basic-company-aspnetcore.localhost/ --allow-write true --client-id "SitecoreCLIServer" --client-secret "testsecret" --client-credentials true +}else { + dotnet sitecore login --cm https://cm.basic-company-aspnetcore.localhost/ --auth https://id.basic-company-aspnetcore.localhost/ --allow-write true +} + if ($LASTEXITCODE -ne 0) { Write-Error "Unable to log into Sitecore, did the Sitecore environment start correctly? See logs above." } @@ -65,6 +99,13 @@ if ($LASTEXITCODE -ne 0) { Write-Error "Serialization push failed, see errors above." } +if (($Topology -eq "xm1") -or ($Topology -eq "xp1")){ + Write-Host "Restart CD" -ForegroundColor Green + Push-Location $workinDirectoryPath + docker-compose restart cd + Pop-Location +} + Write-Host "Opening site..." -ForegroundColor Green Start-Process https://cm.basic-company-aspnetcore.localhost/sitecore/