This repository contains an Aspire AppHost integration for deploying compute resources to Dokploy.
The integration lives in the package project at /src/Ridder.Hosting.Dokploy.
The sample AppHost in /samples/DokployDeploy.AppHost consumes that package project and shows the intended public API.
- Creates or reuses a Dokploy project for an Aspire environment.
- Supports two registry strategies:
- Self-hosted on Dokploy: Dokploy hosts the registry and deployment prompts for the registry domain.
- Hosted registry: deployment prompts for an existing registry URL, username, and password.
- Prompts for the Dokploy API URL and API key during deploy instead of hardcoding connection details.
- Builds and pushes app images, configures Dokploy Docker provider settings, and triggers application deploys.
- Creates Dokploy-managed domains for external Aspire endpoints while preserving the endpoint scheme and port.
- Reconciles application mounts idempotently so repeated deploys do not create duplicate volumes.
The integration is now environment-first.
- Create a Dokploy environment.
- Choose a registry strategy for that environment.
- Opt individual compute resources into Dokploy publishing.
var dokploy = builder.AddDokployEnvironment("dokploydeploy")
.WithHostedRegistry();
builder.AddProject<Projects.MyApi>("api")
.PublishToDokploy(dokploy);Prompted self-hosted registry:
var dokploy = builder.AddDokployEnvironment("dokploydeploy")
.WithSelfHostedRegistry();Prompted hosted registry:
var dokploy = builder.AddDokployEnvironment("dokploydeploy")
.WithHostedRegistry();Explicit values are also supported:
builder.AddDokployEnvironment("dokploydeploy")
.WithSelfHostedRegistry("registry.example.com");
builder.AddDokployEnvironment("dokploydeploy")
.WithHostedRegistry("registry.example.com", "username", "password");Only resources that call PublishToDokploy(...) are provisioned in Dokploy.
var dokploy = builder.AddDokployEnvironment("dokploydeploy")
.WithHostedRegistry();
builder.AddProject<Projects.MyApi>("api")
.PublishToDokploy(dokploy, options =>
{
options.ApplicationName = "custom-api";
options.ConfigureEnvironmentVariables = true;
options.ConfigureMounts = true;
options.CreateDomainsForExternalEndpoints = true;
});The older convenience methods are still available and forward to the new environment-first API:
builder.AddDokployProject(name);
builder.AddDokployProjectSelfHostedRegistry(name);
builder.AddDokployProjectHostedRegistry(name);AddDokployProject(name) maps to AddDokployEnvironment(name).WithSelfHostedRegistry().
The sample AppHost in /samples/DokployDeploy.AppHost/AppHost.cs uses the current recommended shape:
var dokploy = builder.AddDokployEnvironment("dokploydeploy")
.WithHostedRegistry();
var cache = builder.AddRedis("cache")
.WithDataVolume("cache-data")
.PublishToDokploy(dokploy);/src/Ridder.Hosting.Dokploy/DokployExtensions.cscontains the public builder extension surface./src/Ridder.Hosting.Dokploy/DokployProjectEnvironmentResource.csowns the Aspire resource and pipeline wiring./src/Ridder.Hosting.Dokploy/DokployEnvironmentProvisioner.cscoordinates registry preparation and application provisioning./src/Ridder.Hosting.Dokploy/DokployApi*.cscontains Dokploy API orchestration split by responsibility./src/Ridder.Hosting.Dokploy/DokployJsonPayload.csand/src/Ridder.Hosting.Dokploy/DokployResponseReaders.cscontain parsing helpers that can be unit tested independently.
- Resource-to-resource environment wiring is still incomplete.
- The integration is not yet NuGet-ready; it still needs broader behavioral coverage, more extraction around application and environment mapping, and release packaging hardening.