Skip to content

Commit 2b96582

Browse files
authored
Merge pull request #15 from Sitecore/develop
Merge in new Docker Examples content
2 parents 19caa75 + e3a108a commit 2b96582

File tree

168 files changed

+2999
-5955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

168 files changed

+2999
-5955
lines changed

.gitignore

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Ignore thumbnails created by Windows
2+
Thumbs.db
3+
# Ignore files built by Visual Studio
4+
*.obj
5+
*.exe
6+
*.pdb
7+
*.user
8+
*.aps
9+
*.pch
10+
*.vspscc
11+
*_i.c
12+
*_p.c
13+
*.ncb
14+
*.suo
15+
*.tlb
16+
*.tlh
17+
*.bak
18+
*.zip
19+
*.cache
20+
*.ilk
21+
*.log
22+
[Bb]in
23+
[Dd]ebug*/
24+
*.lib
25+
*.sbr
26+
obj/
27+
[Rr]elease*/
28+
_ReSharper*/
29+
[Tt]est[Rr]esult*
30+
.vs/
31+
.vscode/
32+
packages/

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Sitecore
3+
Copyright (c) 2020 Sitecore
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1-
# docker-demo
2-
This is a repository where people can contribute examples, ideas and how-tos on how to use Sitecore Docker Images which are created in the [docker-images](https://github.com/sitecore/docker-images) "sister" repository.
1+
# Sitecore Docker Examples
32

3+
This repository contains companion code for the [Sitecore Containers documentation](https://containers.doc.sitecore.com/). Together, these are meant to help you get started using [Docker](https://www.docker.com/) containers with Sitecore.
4+
5+
Briefly, here's what you'll find in this repo:
6+
7+
* Example for running an out of the box Sitecore instance (see `getting-started`).
8+
* Example solution for creating custom Sitecore images, with recommended folder structure for container development (see `custom-images`).
9+
* Sample PowerShell scripts for container-based Sitecore instance preparation (`init.ps1`) and cleanup (`clean.ps1`).
10+
* Docker compose files for building Sitecore instances in various topologies (see `custom-images`).
11+
12+
Please refer to the [Sitecore Containers documentation](https://containers.doc.sitecore.com/) for complete details, including running the examples and recommended usage.
13+
14+
## Are Docker Examples supported by Sitecore?
15+
16+
Sitecore maintains the Sitecore Containers documentation and Docker Examples, but example code is not supported by Sitecore Product Support Services. Please do not submit support tickets regarding Docker Examples.
17+
18+
## How can I get help with Docker Examples?
19+
20+
Start with the [Sitecore Containers documentation](https://containers.doc.sitecore.com/). For technical issues in particular, check out the [Troubleshooting guide](https://containers.doc.sitecore.com/docs/troubleshooting).
21+
22+
Beyond that, for usage questions regarding Docker Examples installation or code, or general questions about Sitecore Containers, please utilize [Sitecore Stackexchange](https://sitecore.stackexchange.com/) or [#docker](https://sitecorechat.slack.com/messages/docker) on [Sitecore Community Slack](https://sitecore.chat/).
23+
24+
You can use GitHub to submit [issues](https://github.com/Sitecore/docker-examples/issues/new) for Docker Examples, but please do not submit usage questions.

custom-images/.dockerignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# folders
2+
.git
3+
.gitignore
4+
.vs
5+
.vscode
6+
build
7+
docker
8+
packages
9+
**/bin/
10+
**/obj/
11+
**/out/
12+
13+
# files
14+
*Dockerfile
15+
docker-compose*
16+
**/*.md
17+
*.ps1

custom-images/.env

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
COMPOSE_PROJECT_NAME=docker-examples
2+
REGISTRY=
3+
VERSION=
4+
5+
SOLUTION_BUILD_IMAGE=mcr.microsoft.com/dotnet/framework/sdk:4.8
6+
SOLUTION_BASE_IMAGE=mcr.microsoft.com/windows/nanoserver:1809
7+
BUILD_CONFIGURATION=debug
8+
9+
LOCAL_DEPLOY_PATH=.\docker\deploy
10+
LOCAL_DATA_PATH=.\docker\data
11+
12+
CD_HOST=cd.dockerexamples.localhost
13+
CM_HOST=cm.dockerexamples.localhost
14+
ID_HOST=id.dockerexamples.localhost
15+
16+
SITECORE_DOCKER_REGISTRY=scr.sitecore.com/sxp/
17+
SITECORE_TOOLS_REGISTRY=scr.sitecore.com/tools/
18+
SITECORE_MODULE_REGISTRY=scr.sitecore.com/sxp/modules/
19+
SITECORE_VERSION=10.0.0-ltsc2019
20+
TOOLS_VERSION=10.0.0-1809
21+
SPE_VERSION=6.1.1-1809
22+
SXA_VERSION=10.0.0-1809
23+
24+
SITECORE_ADMIN_PASSWORD=
25+
SQL_SA_PASSWORD=
26+
REPORTING_API_KEY=
27+
TELERIK_ENCRYPTION_KEY=
28+
SITECORE_IDSECRET=
29+
SITECORE_ID_CERTIFICATE=
30+
SITECORE_ID_CERTIFICATE_PASSWORD=
31+
SITECORE_LICENSE=
32+
TRAEFIK_IMAGE=traefik:v2.2.0-windowsservercore-1809
33+
TRAEFIK_ISOLATION=hyperv
34+
ISOLATION=default

custom-images/Directory.Build.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Project>
2+
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.46" />
3+
</Project>

custom-images/DockerExamples.sln

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.30002.166
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockerExamples.Website", "src\DockerExamples.Website\DockerExamples.Website.csproj", "{B062D0AC-C7AB-448A-AB55-0791E7AC974A}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockerExamples.XConnect", "src\DockerExamples.XConnect\DockerExamples.XConnect.csproj", "{5A9AB6CC-9800-4725-9967-16A58123D394}"
9+
EndProject
10+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DockerExamples.XConnect.Model", "src\DockerExamples.XConnect.Model\DockerExamples.XConnect.Model.csproj", "{16DC2062-E853-44BB-A006-BC1F4CD5BBCF}"
11+
EndProject
12+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App.XConnect.ModelBuilder", "src\App.XConnect.ModelBuilder\App.XConnect.ModelBuilder.csproj", "{C6144D27-3F34-4761-B040-CB9E8C56955E}"
13+
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".app", ".app", "{D9AF16A6-F9A5-4E42-A37B-A440E8CEACC5}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App.XConnect.Demo", "src\App.XConnect.Demo\App.XConnect.Demo.csproj", "{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E}"
17+
EndProject
18+
Global
19+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
20+
Debug|Any CPU = Debug|Any CPU
21+
Release|Any CPU = Release|Any CPU
22+
EndGlobalSection
23+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
24+
{B062D0AC-C7AB-448A-AB55-0791E7AC974A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{B062D0AC-C7AB-448A-AB55-0791E7AC974A}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{B062D0AC-C7AB-448A-AB55-0791E7AC974A}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{B062D0AC-C7AB-448A-AB55-0791E7AC974A}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{5A9AB6CC-9800-4725-9967-16A58123D394}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{5A9AB6CC-9800-4725-9967-16A58123D394}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{5A9AB6CC-9800-4725-9967-16A58123D394}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{5A9AB6CC-9800-4725-9967-16A58123D394}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{16DC2062-E853-44BB-A006-BC1F4CD5BBCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{16DC2062-E853-44BB-A006-BC1F4CD5BBCF}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{16DC2062-E853-44BB-A006-BC1F4CD5BBCF}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{16DC2062-E853-44BB-A006-BC1F4CD5BBCF}.Release|Any CPU.Build.0 = Release|Any CPU
36+
{C6144D27-3F34-4761-B040-CB9E8C56955E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
37+
{C6144D27-3F34-4761-B040-CB9E8C56955E}.Debug|Any CPU.Build.0 = Debug|Any CPU
38+
{C6144D27-3F34-4761-B040-CB9E8C56955E}.Release|Any CPU.ActiveCfg = Release|Any CPU
39+
{C6144D27-3F34-4761-B040-CB9E8C56955E}.Release|Any CPU.Build.0 = Release|Any CPU
40+
{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
41+
{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E}.Debug|Any CPU.Build.0 = Debug|Any CPU
42+
{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E}.Release|Any CPU.ActiveCfg = Release|Any CPU
43+
{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E}.Release|Any CPU.Build.0 = Release|Any CPU
44+
EndGlobalSection
45+
GlobalSection(SolutionProperties) = preSolution
46+
HideSolutionNode = FALSE
47+
EndGlobalSection
48+
GlobalSection(NestedProjects) = preSolution
49+
{C6144D27-3F34-4761-B040-CB9E8C56955E} = {D9AF16A6-F9A5-4E42-A37B-A440E8CEACC5}
50+
{2FF4ECD0-C43F-4BE2-A261-C386EFFD335E} = {D9AF16A6-F9A5-4E42-A37B-A440E8CEACC5}
51+
EndGlobalSection
52+
GlobalSection(ExtensibilityGlobals) = postSolution
53+
SolutionGuid = {44094B79-5407-4492-B8D1-B0EA37325E6E}
54+
EndGlobalSection
55+
EndGlobal

custom-images/Dockerfile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# escape=`
2+
3+
ARG BASE_IMAGE
4+
ARG BUILD_IMAGE
5+
6+
FROM ${BUILD_IMAGE} AS prep
7+
8+
# Gather only artifacts necessary for NuGet restore, retaining directory structure
9+
COPY *.sln nuget.config Directory.Build.targets Packages.props \nuget\
10+
COPY src\ \temp\
11+
RUN Invoke-Expression 'robocopy C:\temp C:\nuget\src /s /ndl /njh /njs *.csproj *.scproj packages.config'
12+
13+
FROM ${BUILD_IMAGE} AS builder
14+
15+
ARG BUILD_CONFIGURATION
16+
17+
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
18+
19+
# Create an empty working directory
20+
WORKDIR C:\build
21+
22+
# Copy prepped NuGet artifacts, and restore as distinct layer to take better advantage of caching
23+
COPY --from=prep .\nuget .\
24+
RUN nuget restore
25+
26+
# Copy remaining source code
27+
COPY src\ .\src\
28+
29+
# Copy transforms, retaining directory structure
30+
RUN Invoke-Expression 'robocopy C:\build\src C:\out\transforms /s /ndl /njh /njs *.xdt'
31+
32+
# Build website with file publish
33+
RUN msbuild .\src\DockerExamples.Website\DockerExamples.Website.csproj /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\website
34+
35+
# Build XConnect with file publish
36+
RUN msbuild .\src\DockerExamples.XConnect\DockerExamples.XConnect.csproj /p:Configuration=$env:BUILD_CONFIGURATION /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:PublishUrl=C:\out\xconnect
37+
38+
FROM ${BASE_IMAGE}
39+
40+
WORKDIR C:\artifacts
41+
42+
# Copy final build artifacts
43+
COPY --from=builder C:\out\website .\website\
44+
COPY --from=builder C:\out\transforms .\transforms\
45+
COPY --from=builder C:\out\xconnect .\xconnect\

custom-images/Packages.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<PlatformVersion>10.0.0</PlatformVersion>
5+
</PropertyGroup>
6+
<ItemGroup>
7+
<PackageReference Update="Sitecore.XConnect" Version="$(PlatformVersion)" />
8+
<PackageReference Update="Sitecore.XConnect.Client" Version="$(PlatformVersion)" />
9+
<PackageReference Update="Sitecore.XConnect.Collection.Model" Version="$(PlatformVersion)" />
10+
<PackageReference Update="Sitecore.Assemblies.XConnect.Web" Version="$(PlatformVersion)" />
11+
</ItemGroup>
12+
</Project>
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
version: "2.4"
2+
3+
services:
4+
5+
solution:
6+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
7+
build:
8+
context: .
9+
args:
10+
BASE_IMAGE: ${SOLUTION_BASE_IMAGE}
11+
BUILD_IMAGE: ${SOLUTION_BUILD_IMAGE}
12+
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION}
13+
scale: 0
14+
15+
traefik:
16+
volumes:
17+
- ./docker/traefik:C:/etc/traefik
18+
19+
mssql:
20+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-mssql:${VERSION:-latest}
21+
build:
22+
context: ./docker/build/mssql
23+
args:
24+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-mssql:${SITECORE_VERSION}
25+
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
26+
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
27+
mem_limit: 2GB
28+
volumes:
29+
- ${LOCAL_DATA_PATH}\mssql:c:\data
30+
31+
solr:
32+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-solr:${VERSION:-latest}
33+
build:
34+
context: ./docker/build/solr
35+
args:
36+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-solr:${SITECORE_VERSION}
37+
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
38+
mem_limit: 1GB
39+
volumes:
40+
- ${LOCAL_DATA_PATH}\solr:c:\data
41+
42+
id:
43+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-id:${VERSION:-latest}
44+
build:
45+
context: ./docker/build/id
46+
args:
47+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-id:${SITECORE_VERSION}
48+
49+
cm:
50+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cm:${VERSION:-latest}
51+
build:
52+
context: ./docker/build/cm
53+
args:
54+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cm:${SITECORE_VERSION}
55+
SPE_IMAGE: ${SITECORE_MODULE_REGISTRY}spe-assets:${SPE_VERSION}
56+
SXA_IMAGE: ${SITECORE_MODULE_REGISTRY}sxa-xp1-assets:${SXA_VERSION}
57+
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
58+
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
59+
depends_on:
60+
- solution
61+
volumes:
62+
- ${LOCAL_DEPLOY_PATH}\website:C:\deploy
63+
- ${LOCAL_DATA_PATH}\cm:C:\inetpub\wwwroot\App_Data\logs
64+
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
65+
66+
xconnect:
67+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-xconnect:${VERSION:-latest}
68+
build:
69+
context: ./docker/build/xconnect
70+
args:
71+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xconnect:${SITECORE_VERSION}
72+
TOOLING_IMAGE: ${SITECORE_TOOLS_REGISTRY}sitecore-docker-tools-assets:${TOOLS_VERSION}
73+
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
74+
depends_on:
75+
- solution
76+
volumes:
77+
- ${LOCAL_DEPLOY_PATH}\xconnect:C:\deploy
78+
entrypoint: powershell -Command "& C:\tools\entrypoints\iis\Development.ps1"
79+
80+
xdbsearchworker:
81+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-xdbsearchworker:${VERSION:-latest}
82+
build:
83+
context: ./docker/build/xdbsearchworker
84+
args:
85+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbsearchworker:${SITECORE_VERSION}
86+
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
87+
depends_on:
88+
- solution
89+
90+
xdbautomationworker:
91+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-xdbautomationworker:${VERSION:-latest}
92+
build:
93+
context: ./docker/build/xdbautomationworker
94+
args:
95+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-xdbautomationworker:${SITECORE_VERSION}
96+
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
97+
depends_on:
98+
- solution
99+
100+
cortexprocessingworker:
101+
image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-xp0-cortexprocessingworker:${VERSION:-latest}
102+
build:
103+
context: ./docker/build/cortexprocessingworker
104+
args:
105+
BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xp0-cortexprocessingworker:${SITECORE_VERSION}
106+
SOLUTION_IMAGE: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solution:${VERSION:-latest}
107+
depends_on:
108+
- solution

0 commit comments

Comments
 (0)