Skip to content

Commit

Permalink
Merge pull request #35 from Sitecore/develop
Browse files Browse the repository at this point in the history
Sitecore Docker Examples Release #5
  • Loading branch information
nickwesselman committed Apr 6, 2021
2 parents 25aa2b3 + eb51101 commit cc00ba3
Show file tree
Hide file tree
Showing 7 changed files with 150 additions and 5 deletions.
3 changes: 3 additions & 0 deletions custom-images/.env
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ LOCAL_DATA_PATH=.\docker\data
CD_HOST=cd.dockerexamples.localhost
CM_HOST=cm.dockerexamples.localhost
ID_HOST=id.dockerexamples.localhost
HRZ_HOST=hrz.dockerexamples.localhost

SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/
Expand All @@ -20,6 +21,8 @@ SITECORE_VERSION=10.1-ltsc2019
TOOLS_VERSION=10.1-1809
SPE_VERSION=6.2-1809
SXA_VERSION=10.1-1809
HORIZON_VERSION=2.26.0-ltsc2019
HORIZON_ASSET_VERSION=2.26.0-1809

SITECORE_ADMIN_PASSWORD=
SQL_SA_PASSWORD=
Expand Down
44 changes: 42 additions & 2 deletions custom-images/docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ services:
traefik:
volumes:
- ./docker/traefik:C:/etc/traefik
depends_on:
hrz:
condition: service_healthy

mssql:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-mssql:${VERSION:-latest}
Expand All @@ -24,6 +27,7 @@ services:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-mssql:${SITECORE_VERSION}
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp0-assets:${HORIZON_ASSET_VERSION}
mem_limit: 2GB
volumes:
- ${LOCAL_DATA_PATH}\mssql:c:\data
Expand All @@ -48,7 +52,8 @@ services:
context: ./docker/build/id
args:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}

environment:
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}
cm:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cm:${VERSION:-latest}
build:
Expand All @@ -59,13 +64,15 @@ services:
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp0-assets:${HORIZON_ASSET_VERSION}
depends_on:
- solution
volumes:
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
environment:
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"

xconnect:
Expand Down Expand Up @@ -110,4 +117,37 @@ services:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cortexprocessingworker:${SITECORE_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
depends_on:
- solution
- solution
hrz:
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
isolation: ${ISOLATION}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
timeout: 300s
environment:
Sitecore_License: ${SITECORE_LICENSE}
Sitecore_FederatedUI__HostBaseUrl: http://hrz
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
depends_on:
id:
condition: service_started
cm:
condition: service_started
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.sh-secure.entrypoints=websecure"
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
- "traefik.http.routers.sh-secure.tls=true"
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
- "traefik.http.services.sh.loadbalancer.server.port=80"
44 changes: 43 additions & 1 deletion custom-images/docker-compose.xm1.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ services:
traefik:
volumes:
- ./docker/traefik:C:/etc/traefik
depends_on:
hrz:
condition: service_healthy

redis:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest}
Expand All @@ -31,6 +34,7 @@ services:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION}
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xm1-assets:${SXA_VERSION}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xm1-assets:${HORIZON_ASSET_VERSION}
mem_limit: 2GB
volumes:
- ${LOCAL_DATA_PATH}\mssql:c:\data
Expand All @@ -55,6 +59,8 @@ services:
context: ./docker/build/id
args:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
environment:
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}

cd:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-cd:${VERSION:-latest}
Expand Down Expand Up @@ -83,6 +89,7 @@ services:
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xm1-assets:${SXA_VERSION}
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xm1-assets:${HORIZON_ASSET_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
depends_on:
- solution
Expand All @@ -91,4 +98,39 @@ services:
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
environment:
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
hrz:
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
isolation: ${ISOLATION}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
timeout: 300s
environment:
Sitecore_License: ${SITECORE_LICENSE}
Sitecore_FederatedUI__HostBaseUrl: http://hrz
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
depends_on:
id:
condition: service_started
cm:
condition: service_started
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.sh-secure.entrypoints=websecure"
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
- "traefik.http.routers.sh-secure.tls=true"
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
- "traefik.http.services.sh.loadbalancer.server.port=80"

44 changes: 43 additions & 1 deletion custom-images/docker-compose.xp1.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ services:
traefik:
volumes:
- ./docker/traefik:C:/etc/traefik
depends_on:
hrz:
condition: service_healthy

redis:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest}
Expand All @@ -31,6 +34,7 @@ services:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql:${SITECORE_VERSION}
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp1-assets:${HORIZON_ASSET_VERSION}
mem_limit: 2GB
volumes:
- ${LOCAL_DATA_PATH}\mssql:c:\data
Expand All @@ -55,6 +59,8 @@ services:
context: ./docker/build/id
args:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
environment:
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}

cd:
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp1-cd:${VERSION:-latest}
Expand Down Expand Up @@ -84,13 +90,15 @@ services:
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp1-assets:${HORIZON_ASSET_VERSION}
depends_on:
- solution
volumes:
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
environment:
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"

prc:
Expand Down Expand Up @@ -189,4 +197,38 @@ services:
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-cortexprocessingworker:${SITECORE_VERSION}
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
depends_on:
- solution
- solution

hrz:
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
isolation: ${ISOLATION}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
timeout: 300s
environment:
Sitecore_License: ${SITECORE_LICENSE}
Sitecore_FederatedUI__HostBaseUrl: http://hrz
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
depends_on:
id:
condition: service_started
cm:
condition: service_started
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.sh-secure.entrypoints=websecure"
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
- "traefik.http.routers.sh-secure.tls=true"
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
- "traefik.http.services.sh.loadbalancer.server.port=80"
6 changes: 6 additions & 0 deletions custom-images/docker/build/cm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ ARG SXA_IMAGE
ARG SPE_IMAGE
ARG TOOLING_IMAGE
ARG SOLUTION_IMAGE
ARG HORIZON_RESOURCES_IMAGE

FROM ${SOLUTION_IMAGE} as solution
FROM ${TOOLING_IMAGE} as tooling
FROM ${SPE_IMAGE} as spe
FROM ${SXA_IMAGE} as sxa
FROM ${HORIZON_RESOURCES_IMAGE} as horizon_resources
FROM ${BASE_IMAGE}


SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

# Copy development tools and entrypoint
Expand All @@ -28,6 +31,9 @@ COPY --from=sxa \module\tools \module\tools
RUN C:\module\tools\Initialize-Content.ps1 -TargetPath .\; `
Remove-Item -Path C:\module -Recurse -Force;

# Add horizon module
COPY --from=horizon_resources \module\cm\content \inetpub\wwwroot

# Copy solution website files
COPY --from=solution \artifacts\website\ .\

Expand Down
10 changes: 9 additions & 1 deletion custom-images/docker/build/mssql/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
ARG BASE_IMAGE
ARG SXA_IMAGE
ARG SPE_IMAGE
ARG HORIZON_RESOURCES_IMAGE

FROM ${SPE_IMAGE} as spe
FROM ${SXA_IMAGE} as sxa
FROM ${HORIZON_RESOURCES_IMAGE} as horizon_resourses
FROM ${BASE_IMAGE}

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
Expand All @@ -18,4 +20,10 @@ RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\spe_data; `
# Add SXA module
COPY --from=sxa \module\db \sxa_data
RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\sxa_data; `
Remove-Item -Path C:\sxa_data -Recurse -Force;
Remove-Item -Path C:\sxa_data -Recurse -Force;

# Add Horizon module
COPY --from=horizon_resourses \module\db \horizon_integration_data

RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\horizon_integration_data; `
Remove-Item -Path C:\horizon_integration_data -Recurse -Force;
4 changes: 4 additions & 0 deletions custom-images/init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ Set-EnvFileVariable "CM_HOST" -Value "cm.$($HostName).localhost"
# ID_HOST
Set-EnvFileVariable "ID_HOST" -Value "id.$($HostName).localhost"

# HRZ_HOST
Set-EnvFileVariable "HRZ_HOST" -Value "hrz.$($HostName).localhost"

# REPORTING_API_KEY = random 64-128 chars
Set-EnvFileVariable "REPORTING_API_KEY" -Value (Get-SitecoreRandomString 64 -DisallowSpecial)

Expand Down Expand Up @@ -128,5 +131,6 @@ Write-Host "Adding Windows hosts file entries..." -ForegroundColor Green
Add-HostsEntry "cd.$($HostName).localhost"
Add-HostsEntry "cm.$($HostName).localhost"
Add-HostsEntry "id.$($HostName).localhost"
Add-HostsEntry "hrz.$($HostName).localhost"

Write-Host "Done!" -ForegroundColor Green

0 comments on commit cc00ba3

Please sign in to comment.