Skip to content

Commit cc00ba3

Browse files
Merge pull request #35 from Sitecore/develop
Sitecore Docker Examples Release #5
2 parents 25aa2b3 + eb51101 commit cc00ba3

File tree

7 files changed

+150
-5
lines changed

7 files changed

+150
-5
lines changed

custom-images/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ LOCAL_DATA_PATH=.\docker\data
1212
CD_HOST=cd.dockerexamples.localhost
1313
CM_HOST=cm.dockerexamples.localhost
1414
ID_HOST=id.dockerexamples.localhost
15+
HRZ_HOST=hrz.dockerexamples.localhost
1516

1617
SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
1718
SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/
@@ -20,6 +21,8 @@ SITECORE_VERSION=10.1-ltsc2019
2021
TOOLS_VERSION=10.1-1809
2122
SPE_VERSION=6.2-1809
2223
SXA_VERSION=10.1-1809
24+
HORIZON_VERSION=2.26.0-ltsc2019
25+
HORIZON_ASSET_VERSION=2.26.0-1809
2326

2427
SITECORE_ADMIN_PASSWORD=
2528
SQL_SA_PASSWORD=

custom-images/docker-compose.override.yml

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ services:
1515
traefik:
1616
volumes:
1717
- ./docker/traefik:C:/etc/traefik
18+
depends_on:
19+
hrz:
20+
condition: service_healthy
1821

1922
mssql:
2023
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-mssql:${VERSION:-latest}
@@ -24,6 +27,7 @@ services:
2427
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-mssql:${SITECORE_VERSION}
2528
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
2629
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
30+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp0-assets:${HORIZON_ASSET_VERSION}
2731
mem_limit: 2GB
2832
volumes:
2933
- ${LOCAL_DATA_PATH}\mssql:c:\data
@@ -48,7 +52,8 @@ services:
4852
context: ./docker/build/id
4953
args:
5054
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
51-
55+
environment:
56+
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}
5257
cm:
5358
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cm:${VERSION:-latest}
5459
build:
@@ -59,13 +64,15 @@ services:
5964
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
6065
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
6166
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
67+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp0-assets:${HORIZON_ASSET_VERSION}
6268
depends_on:
6369
- solution
6470
volumes:
6571
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
6672
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
6773
environment:
6874
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
75+
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
6976
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
7077

7178
xconnect:
@@ -110,4 +117,37 @@ services:
110117
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cortexprocessingworker:${SITECORE_VERSION}
111118
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
112119
depends_on:
113-
- solution
120+
- solution
121+
hrz:
122+
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
123+
isolation: ${ISOLATION}
124+
healthcheck:
125+
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
126+
timeout: 300s
127+
environment:
128+
Sitecore_License: ${SITECORE_LICENSE}
129+
Sitecore_FederatedUI__HostBaseUrl: http://hrz
130+
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
131+
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
132+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
133+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
134+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
135+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
136+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
137+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
138+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
139+
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
140+
depends_on:
141+
id:
142+
condition: service_started
143+
cm:
144+
condition: service_started
145+
labels:
146+
- "traefik.enable=true"
147+
- "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true"
148+
- "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000"
149+
- "traefik.http.routers.sh-secure.entrypoints=websecure"
150+
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
151+
- "traefik.http.routers.sh-secure.tls=true"
152+
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
153+
- "traefik.http.services.sh.loadbalancer.server.port=80"

custom-images/docker-compose.xm1.override.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ services:
1515
traefik:
1616
volumes:
1717
- ./docker/traefik:C:/etc/traefik
18+
depends_on:
19+
hrz:
20+
condition: service_healthy
1821

1922
redis:
2023
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest}
@@ -31,6 +34,7 @@ services:
3134
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql:${SITECORE_VERSION}
3235
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
3336
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xm1-assets:${SXA_VERSION}
37+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xm1-assets:${HORIZON_ASSET_VERSION}
3438
mem_limit: 2GB
3539
volumes:
3640
- ${LOCAL_DATA_PATH}\mssql:c:\data
@@ -55,6 +59,8 @@ services:
5559
context: ./docker/build/id
5660
args:
5761
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
62+
environment:
63+
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}
5864

5965
cd:
6066
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xm1-cd:${VERSION:-latest}
@@ -83,6 +89,7 @@ services:
8389
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
8490
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xm1-assets:${SXA_VERSION}
8591
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
92+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xm1-assets:${HORIZON_ASSET_VERSION}
8693
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
8794
depends_on:
8895
- solution
@@ -91,4 +98,39 @@ services:
9198
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
9299
environment:
93100
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
94-
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
101+
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
102+
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
103+
hrz:
104+
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
105+
isolation: ${ISOLATION}
106+
healthcheck:
107+
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
108+
timeout: 300s
109+
environment:
110+
Sitecore_License: ${SITECORE_LICENSE}
111+
Sitecore_FederatedUI__HostBaseUrl: http://hrz
112+
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
113+
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
114+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
115+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
116+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
117+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
118+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
119+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
120+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
121+
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
122+
depends_on:
123+
id:
124+
condition: service_started
125+
cm:
126+
condition: service_started
127+
labels:
128+
- "traefik.enable=true"
129+
- "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true"
130+
- "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000"
131+
- "traefik.http.routers.sh-secure.entrypoints=websecure"
132+
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
133+
- "traefik.http.routers.sh-secure.tls=true"
134+
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
135+
- "traefik.http.services.sh.loadbalancer.server.port=80"
136+

custom-images/docker-compose.xp1.override.yml

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ services:
1515
traefik:
1616
volumes:
1717
- ./docker/traefik:C:/etc/traefik
18+
depends_on:
19+
hrz:
20+
condition: service_healthy
1821

1922
redis:
2023
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-redis:${VERSION:-latest}
@@ -31,6 +34,7 @@ services:
3134
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-mssql:${SITECORE_VERSION}
3235
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
3336
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
37+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp1-assets:${HORIZON_ASSET_VERSION}
3438
mem_limit: 2GB
3539
volumes:
3640
- ${LOCAL_DATA_PATH}\mssql:c:\data
@@ -55,6 +59,8 @@ services:
5559
context: ./docker/build/id
5660
args:
5761
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
62+
environment:
63+
Sitecore_Sitecore__IdentityServer__Clients__DefaultClient__AllowedCorsOrigins__AllowedCorsOriginsGroup2: https://${HRZ_HOST}
5864

5965
cd:
6066
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp1-cd:${VERSION:-latest}
@@ -84,13 +90,15 @@ services:
8490
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
8591
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
8692
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
93+
HORIZON_RESOURCES_IMAGE: ${SITECORE_MODULE_REGISTRY}horizon-integration-xp1-assets:${HORIZON_ASSET_VERSION}
8794
depends_on:
8895
- solution
8996
volumes:
9097
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
9198
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
9299
environment:
93100
SITECORE_DEVELOPMENT_PATCHES: CustomErrorsOff
101+
Sitecore_Horizon_ClientHost: https://${HRZ_HOST}
94102
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
95103

96104
prc:
@@ -189,4 +197,38 @@ services:
189197
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp1-cortexprocessingworker:${SITECORE_VERSION}
190198
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
191199
depends_on:
192-
- solution
200+
- solution
201+
202+
hrz:
203+
image: ${SITECORE_MODULE_REGISTRY}sitecore-horizon:${HORIZON_VERSION}
204+
isolation: ${ISOLATION}
205+
healthcheck:
206+
test: ["CMD", "curl", "-f", "http://localhost/healthz/live"]
207+
timeout: 300s
208+
environment:
209+
Sitecore_License: ${SITECORE_LICENSE}
210+
Sitecore_FederatedUI__HostBaseUrl: http://hrz
211+
Sitecore_SitecorePlatform__ContentManagementUrl: https://${CM_HOST}
212+
Sitecore_SitecorePlatform__ContentManagementInternalUrl: http://cm
213+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__RequireHttpsMetadata: 'false'
214+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__Authority: https://${ID_HOST}
215+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__CallbackAuthority: https://${HRZ_HOST}
216+
Sitecore_Sitecore__Authentication__OpenIdConnectOptions__InternalAuthority: http://id
217+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__Authority: https://${ID_HOST}
218+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__InternalAuthority: http://id
219+
Sitecore_Sitecore__Authentication__BearerAuthenticationOptions__RequireHttpsMetadata: 'false'
220+
Sitecore_Plugins__Filters__ExperienceAccelerator: +SXA
221+
depends_on:
222+
id:
223+
condition: service_started
224+
cm:
225+
condition: service_started
226+
labels:
227+
- "traefik.enable=true"
228+
- "traefik.http.middlewares.force-STS-Header.headers.forceSTSHeader=true"
229+
- "traefik.http.middlewares.force-STS-Header.headers.stsSeconds=31536000"
230+
- "traefik.http.routers.sh-secure.entrypoints=websecure"
231+
- "traefik.http.routers.sh-secure.rule=Host(`${HRZ_HOST}`)"
232+
- "traefik.http.routers.sh-secure.tls=true"
233+
- "traefik.http.routers.sh-secure.middlewares=force-STS-Header"
234+
- "traefik.http.services.sh.loadbalancer.server.port=80"

custom-images/docker/build/cm/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ ARG SXA_IMAGE
55
ARG SPE_IMAGE
66
ARG TOOLING_IMAGE
77
ARG SOLUTION_IMAGE
8+
ARG HORIZON_RESOURCES_IMAGE
89

910
FROM ${SOLUTION_IMAGE} as solution
1011
FROM ${TOOLING_IMAGE} as tooling
1112
FROM ${SPE_IMAGE} as spe
1213
FROM ${SXA_IMAGE} as sxa
14+
FROM ${HORIZON_RESOURCES_IMAGE} as horizon_resources
1315
FROM ${BASE_IMAGE}
1416

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

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

34+
# Add horizon module
35+
COPY --from=horizon_resources \module\cm\content \inetpub\wwwroot
36+
3137
# Copy solution website files
3238
COPY --from=solution \artifacts\website\ .\
3339

custom-images/docker/build/mssql/Dockerfile

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
ARG BASE_IMAGE
44
ARG SXA_IMAGE
55
ARG SPE_IMAGE
6+
ARG HORIZON_RESOURCES_IMAGE
67

78
FROM ${SPE_IMAGE} as spe
89
FROM ${SXA_IMAGE} as sxa
10+
FROM ${HORIZON_RESOURCES_IMAGE} as horizon_resourses
911
FROM ${BASE_IMAGE}
1012

1113
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
@@ -18,4 +20,10 @@ RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\spe_data; `
1820
# Add SXA module
1921
COPY --from=sxa \module\db \sxa_data
2022
RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\sxa_data; `
21-
Remove-Item -Path C:\sxa_data -Recurse -Force;
23+
Remove-Item -Path C:\sxa_data -Recurse -Force;
24+
25+
# Add Horizon module
26+
COPY --from=horizon_resourses \module\db \horizon_integration_data
27+
28+
RUN C:\DeployDatabases.ps1 -ResourcesDirectory C:\horizon_integration_data; `
29+
Remove-Item -Path C:\horizon_integration_data -Recurse -Force;

custom-images/init.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ Set-EnvFileVariable "CM_HOST" -Value "cm.$($HostName).localhost"
6868
# ID_HOST
6969
Set-EnvFileVariable "ID_HOST" -Value "id.$($HostName).localhost"
7070

71+
# HRZ_HOST
72+
Set-EnvFileVariable "HRZ_HOST" -Value "hrz.$($HostName).localhost"
73+
7174
# REPORTING_API_KEY = random 64-128 chars
7275
Set-EnvFileVariable "REPORTING_API_KEY" -Value (Get-SitecoreRandomString 64 -DisallowSpecial)
7376

@@ -128,5 +131,6 @@ Write-Host "Adding Windows hosts file entries..." -ForegroundColor Green
128131
Add-HostsEntry "cd.$($HostName).localhost"
129132
Add-HostsEntry "cm.$($HostName).localhost"
130133
Add-HostsEntry "id.$($HostName).localhost"
134+
Add-HostsEntry "hrz.$($HostName).localhost"
131135

132136
Write-Host "Done!" -ForegroundColor Green

0 commit comments

Comments
 (0)