Containerizes Orchard Core CMS with Docker using multi-stage builds, docker-compose, HTTPS, and CI/CD. Covers database providers, persistent volumes, environment variables, and scaling.
Ships in orchardcore. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are an Orchard Core expert. Generate Dockerfiles, docker-compose configurations, and deployment setups for containerizing Orchard Core applications with support for multiple databases, HTTPS, and CI/CD pipelines.
LABEL stage=build-env to enable easy pruning..dockerignore file to exclude App_Data/, bin/, and obj/ directories.docker-compose to orchestrate Orchard Core with database services (SQL Server, MySQL, PostgreSQL).net11.0: build with mcr.microsoft.com/dotnet/sdk:11.0 and run on mcr.microsoft.com/dotnet/aspnet:11.0 (or their -alpine/-nanoserver-ltsc2025 variants).dotnet publish of an app referencing OrchardCore.Application.Cms.Targets or OrchardCore.Application.Mvc.Targets always creates a wwwroot folder in the output, even when the project has none, so static files and the resized image cache work in the container. If a published app has no wwwroot, update the Orchard Core packages.{ "steps": [...] }.sealed modifier.Use a multi-stage Dockerfile to build and publish the Orchard Core application with the SDK, then create a lean runtime image:
# TARGETARCH and TARGETOS are set automatically when --platform is provided.
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:11.0 AS build-env
ARG TARGETOS
LABEL stage=build-env
WORKDIR /source
# .dockerignore excludes App_Data and binaries from these.
COPY ./src ./src
COPY Directory.Build.props .
COPY Directory.Packages.props .
RUN dotnet publish src/OrchardCore.Cms.Web/OrchardCore.Cms.Web.csproj -c Release -o /app --framework net11.0 /p:RunAnalyzers=false
# Pick the runtime image for the target OS.
FROM mcr.microsoft.com/dotnet/aspnet:11.0-nanoserver-ltsc2025 AS build_windows
FROM mcr.microsoft.com/dotnet/aspnet:11.0 AS build_linux
FROM build_${TARGETOS} AS aspnet
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
WORKDIR /app
COPY --from=build-env /app/ .
ENTRYPOINT ["dotnet", "OrchardCore.Cms.Web.dll"]
This is the Dockerfile of the Orchard Core repository. Copy
Directory.Build.props and Directory.Packages.props (central package
management) when your solution has them, or the restore fails. Build a specific
platform with docker buildx build --platform linux/amd64 -t orchardcore-app ..
For a custom Orchard Core application (not from source), adapt the Dockerfile to your project structure:
FROM mcr.microsoft.com/dotnet/sdk:11.0 AS build-env
LABEL stage=build-env
WORKDIR /app
# Copy solution, build props and project files first for layer caching.
# Adjust to the files your solution has (.sln or .slnx, Directory.*.props).
COPY *.slnx Directory.Build.props Directory.Packages.props ./
COPY src/MyOrchardApp.Web/MyOrchardApp.Web.csproj ./src/MyOrchardApp.Web/
RUN dotnet restore src/MyOrchardApp.Web/MyOrchardApp.Web.csproj
# Copy full source and publish
COPY . .
RUN dotnet publish src/MyOrchardApp.Web -c Release -o /app/publish --no-restore
# Runtime image
FROM mcr.microsoft.com/dotnet/aspnet:11.0
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
WORKDIR /app
COPY --from=build-env /app/publish .
ENTRYPOINT ["dotnet", "MyOrchardApp.Web.dll"]
Create a .dockerignore file at the solution root to exclude unnecessary files from the Docker build context:
# Ignore all
**
# Include source for building
!./src/*
# Ignore App_Data
**/App_Data/
# Ignore build artifacts
**/[b|B]in/
**/[O|o]bj/
# Navigate to the folder containing the Dockerfile
cd /orchardcore
# Build the image
docker build -t orchardcore-app .
# Run the container on port 80
docker run -p 80:80 orchardcore-app
# Build with intermediate image cleanup
docker build -t orchardcore-app --rm .
# Prune intermediate build images
docker image prune -f --filter label=stage=build-env
Use docker-compose.yml to run Orchard Core alongside SQL Server, MySQL, and PostgreSQL services:
services:
web:
build:
context: .
dockerfile: Dockerfile
ports:
- "5009:80"
depends_on:
- sqlserver
- mysql
- postgresql
sqlserver:
image: "mcr.microsoft.com/mssql/server"
environment:
SA_PASSWORD: "P@ssw0rd!123456"
ACCEPT_EULA: "Y"
mysql:
image: mysql:latest
restart: always
environment:
MYSQL_DATABASE: 'orchardcore_database'
MYSQL_USER: 'orchardcore_user'
MYSQL_PASSWORD: 'orchardcore_password'
MYSQL_ROOT_PASSWORD: 'root_password'
ports:
- '3306:3306'
expose:
- '3306'
volumes:
- mysql-data:/var/lib/mysql
postgresql:
image: postgres:latest
volumes:
- postgresql-data:/var/lib/postgresql/data
ports:
- 5432:5432
environment:
POSTGRES_USER: orchardcore_user
POSTGRES_PASSWORD: orchardcore_password
POSTGRES_DB: orchardcore_database
volumes:
mysql-data:
postgresql-data:
# Build images if not already built
docker-compose build
# Prune intermediate build images
docker image prune -f --filter label=stage=build-env
# Start all containers
docker-compose up
# Start in detached mode
docker-compose up -d
# Stop and remove containers
docker-compose down
# Rebuild and restart
docker-compose up --build
A minimal docker-compose.yml for SQLite (no external database required):
services:
web:
build:
context: .
dockerfile: Dockerfile
ports:
- "8080:80"
volumes:
- app-data:/app/App_Data
volumes:
app-data:
App_Data holds tenant settings, SQLite databases, the local media store and
the default Data Protection keys, so it must be a persistent volume.
Orchard Core 4.0 groups configuration sections by service, without the
OrchardCore_ prefix, which keeps environment variable names short:
services:
web:
image: orchardcore-app
environment:
ASPNETCORE_ENVIRONMENT: Production
OrchardCore__Media__MaxFileSize: "104857600"
OrchardCore__Media__Azure__ConnectionString: "${MEDIA_BLOB_CONNECTION}"
OrchardCore__Media__Azure__ContainerName: "media"
OrchardCore__DataProtection__Azure__ConnectionString: "${DP_BLOB_CONNECTION}"
OrchardCore__Redis__Configuration: "redis:6379,abortConnect=false"
OrchardCore__TempDirectory__Path: "/app/data/temp"
volumes:
- app-data:/app/App_Data
- temp-data:/app/data/temp
volumes:
app-data:
temp-data:
OrchardCore__OrchardCore_Media_Azure__ConnectionString still work but are deprecated; the new name wins when both are set.OrchardCore__TempDirectory__Path moves chunked and TUS uploads and deployment and recipe archives off the container's small temp volume (MediaOptions.TusTempPath no longer exists). See orchardcore-temp-file-storage.ORCHARD_APP_DATA relocates the whole App_Data folder (for example to a mounted volume); do not use absolute paths in Media:AssetsPath..env file rather than hard-coding them. Tenant auto setup values follow the same pattern (OrchardCore__AutoSetup__..., see orchardcore-auto-setup).Container instances do not share local disks, so a scaled-out deployment needs:
| Concern | Use |
|---|---|
| Media files | OrchardCore.Media.Azure.Storage or OrchardCore.Media.AmazonS3 (orchardcore-azure-media, orchardcore-amazon-s3-media) |
| Data Protection keys | OrchardCore.DataProtection.Azure or OrchardCore.Redis.DataProtection |
| Cache invalidation, locks | OrchardCore.Redis.Bus, OrchardCore.Redis.Cache, OrchardCore.Redis.Lock |
| Media Gallery real-time updates | OrchardCore.SignalR.Redis or OrchardCore.SignalR.Azure |
| TUS resumable uploads | Shared TempDirectory:Path volume (NFS, Azure Files, EFS), cloud media storage, or sticky sessions |
| Tenant settings | AddDatabaseShellsConfiguration() or AddAzureShellsConfiguration() (see orchardcore-shells), or a shared App_Data volume |
services:
web:
image: orchardcore-app
deploy:
replicas: 3
environment:
OrchardCore__Redis__Configuration: "redis:6379,abortConnect=false"
OrchardCore__TempDirectory__Path: "/mnt/shared/temp"
volumes:
- shared-temp:/mnt/shared/temp
redis:
image: redis:7
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
volumes:
shared-temp:
redis-data:
Enable OrchardCore.Redis, OrchardCore.Redis.Cache, OrchardCore.Redis.Bus,
OrchardCore.Redis.Lock, OrchardCore.Redis.DataProtection and
OrchardCore.SignalR.Redis in the tenant (see orchardcore-redis and
orchardcore-media-gallery). Redis must persist data (AOF or RDB) because it
holds the Data Protection keys.
For HTTPS deployment in Docker containers, refer to the ASP.NET Core documentation for hosting with HTTPS. Common approaches include:
Example with a PFX certificate:
FROM mcr.microsoft.com/dotnet/aspnet:11.0
EXPOSE 80
EXPOSE 443
ENV ASPNETCORE_URLS="https://+:443;http://+:80"
ENV ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
ENV ASPNETCORE_Kestrel__Certificates__Default__Password=YourCertPassword
WORKDIR /app
COPY --from=build-env /app/publish .
ENTRYPOINT ["dotnet", "MyOrchardApp.Web.dll"]
Run with certificate volume:
docker run -p 443:443 -p 80:80 \
-v ${HOME}/.aspnet/https:/https:ro \
orchardcore-app
Target specific .NET base images for different environments:
| Environment | SDK Image | Runtime Image |
|---|---|---|
| Linux x64 | mcr.microsoft.com/dotnet/sdk:11.0 | mcr.microsoft.com/dotnet/aspnet:11.0 |
| Linux Alpine | mcr.microsoft.com/dotnet/sdk:11.0-alpine | mcr.microsoft.com/dotnet/aspnet:11.0-alpine |
| Windows | mcr.microsoft.com/dotnet/sdk:11.0-nanoserver-ltsc2025 | mcr.microsoft.com/dotnet/aspnet:11.0-nanoserver-ltsc2025 |
Alpine-based images produce the smallest containers but may have compatibility
differences. Image resizing uses NetVips; its native libvips binaries come from
the NetVips.Native package, so add the matching NetVips.Native.<rid> package
to the web project when you publish for a runtime it does not cover.
The .NET 8+ images include an app user. To run without root, listen on an
unprivileged port and make the volumes writable by that user:
FROM mcr.microsoft.com/dotnet/aspnet:11.0
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
WORKDIR /app
COPY --from=build-env /app/publish .
RUN mkdir -p /app/App_Data && chown -R $APP_UID /app/App_Data
USER $APP_UID
ENTRYPOINT ["dotnet", "MyOrchardApp.Web.dll"]
For CI/CD pipelines (e.g., GitHub Actions), the application is typically built on the CI host rather than inside the Docker image. Use a simplified Dockerfile that copies pre-built artifacts:
# A prerequisite is a published application in .build/release
FROM --platform=$BUILDPLATFORM golang:alpine AS build
ARG TARGETOS
FROM mcr.microsoft.com/dotnet/aspnet:11.0-nanoserver-ltsc2025 AS build_windows
FROM mcr.microsoft.com/dotnet/aspnet:11.0 AS build_linux
FROM build_${TARGETOS} AS aspnet
EXPOSE 80
ENV ASPNETCORE_URLS=http://+:80
WORKDIR /app
COPY .build/release /app
ENTRYPOINT ["dotnet", "OrchardCore.Cms.Web.dll"]
This mirrors the repository's Dockerfile-CI; the small golang:alpine stage
only lets BuildKit resolve TARGETOS. A single-platform pipeline can simply use
FROM mcr.microsoft.com/dotnet/aspnet:11.0 and COPY ./publish ..
This avoids the intermediate build stage and produces faster image builds in the pipeline.
Intermediate build images accumulate disk space over time. Always prune them after building:
# Prune only Orchard Core build stage images
docker image prune -f --filter label=stage=build-env
# Prune all dangling images
docker image prune -f
# Full system cleanup (use with caution)
docker system prune -f
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/orchardcore:orchardcore-dockerfrom orchardcore
npx claudepluginhub crestapps/crestapps.agentskills --plugin orchardcore140 skills in this plugin
/orchardcore-adminGuidance for the Orchard Core admin panel, including admin controllers and routes, admin menu registration with AdminNavigationProvider, ocat editor forms grouped in cards, admin pages rendering Model.Editor, the UI text casing standard, TheAdmin layout and menu colors, admin branding, the Navbar shape, the Ctrl+K quick navigation palette and QuickNavigationSource, AdminSettings such as MenuBehavior, ShowBreadcrumb, DisplayQuickNavigation, DisplayTitlesInTopbar and ActionsLayout, the AdminDashboard shape, settings pages, and admin filters and zones. Use this skill when requests mention the Orchard Core admin panel, TheAdmin, admin controllers, admin menu registration, an icon on an admin menu item, the AdminSettings recipe step, quick navigation, navigation menu behavior, the admin URL prefix, UI text casing. Strong matches include OrchardCore.Admin, AdminSettings, AdminPermissions, AdminOptions, AdminAttribute, SiteDisplayDriver, IDisplayManager./orchardcore-admin-dashboardSkill for creating admin dashboard widgets in Orchard Core. Covers the DashboardWidget stereotype, DashboardPart position and sizing, the built-in HtmlDashboardWidget, ContentsMetadata and ContentsTags widget types, custom widget content types via recipe or migration, arranging widgets in Manage Dashboard mode, widget template customization, provisioning widgets with recipes, dashboard permissions, the DashboardBreadcrumbProvider Dashboard ancestor, and the AdminDashboardContent shape used when the feature is disabled. Use this skill when requests mention Orchard Core Admin Dashboard, Create and Configure Dashboard Widgets, Enabling Admin Dashboard, Widget Configuration Properties, dashboard widget recipes, Dashboard breadcrumb, or related implementation, setup, or troubleshooting work. Strong matches include OrchardCore.AdminDashboard, DashboardPart, DashboardBreadcrumbProvider, AccessAdminDashboard, ManageAdminDashboard.Other plugins' skills for the same job