diff --git a/src/frontend/src/content/docs/integrations/databases/ravendb/ravendb-host.mdx b/src/frontend/src/content/docs/integrations/databases/ravendb/ravendb-host.mdx
index 89c9d9bb7..d4a729940 100644
--- a/src/frontend/src/content/docs/integrations/databases/ravendb/ravendb-host.mdx
+++ b/src/frontend/src/content/docs/integrations/databases/ravendb/ravendb-host.mdx
@@ -65,15 +65,11 @@ This updates your `aspire.config.json` with the RavenDB hosting integration pack
```json title="aspire.config.json" ins={3}
{
"packages": {
- "CommunityToolkit.Aspire.Hosting.RavenDB": "13.2.1-beta.532"
+ "CommunityToolkit.Aspire.Hosting.RavenDB": "13.4.0"
}
}
```
-
- The TypeScript AppHost SDK doesn't currently expose `addRavenDB` or related APIs. The hosting integration is only available from C# AppHosts. If you're using a TypeScript AppHost, model the RavenDB server with [`builder.addContainer(...)`](/get-started/app-host/) until TypeScript support is added.
-
-
@@ -81,6 +77,9 @@ This updates your `aspire.config.json` with the RavenDB hosting integration pack
Once you've installed the hosting integration in your AppHost project, you can add a RavenDB server resource and then add a database resource:
+
+
+
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
@@ -94,6 +93,27 @@ builder.AddProject("apiservice")
// After adding all resources, run the app...
```
+
+
+
+```typescript title="apphost.mts"
+import { createBuilder } from './.aspire/modules/aspire.mjs';
+
+const builder = await createBuilder();
+
+const ravenServer = await builder.addRavenDB("ravenServer");
+const ravendb = await ravenServer.addDatabase("ravendb");
+
+const apiService = await builder.addProject("apiservice", "../ExampleProject/ExampleProject.csproj")
+ .withReference(ravendb)
+ .waitFor(ravendb);
+
+// After adding all resources, run the app...
+```
+
+
+
+
1. When Aspire adds a container image to the app host, as shown in the preceding example with the `docker.io/ravendb/ravendb` image, it creates a new RavenDB instance on your local machine.
@@ -104,10 +124,12 @@ builder.AddProject("apiservice")
-
- A valid RavenDB license is required. If you don't have one yet, you can request a free Community license at
- [ravendb.net/license/request/community](https://ravendb.net/license/request/community).
- Pass the license via the `RAVEN_License` environment variable, or use `RavenDBServerSettings` to configure it.
+
+ Depending on your usage, RavenDB may require a license. For development, request a free
+ [Developer license](https://ravendb.net/license/request/dev). For production, see the
+ [available licenses](https://ravendb.net/buy) — including a free Community license that's
+ eligible for commercial use. Pass your license via the `RAVEN_License` environment variable,
+ or with `RavenDBServerSettings` from a C# AppHost.
@@ -118,6 +140,9 @@ builder.AddProject("apiservice")
By default, `AddDatabase` registers the database in the Aspire model but does not create it in RavenDB automatically. Pass `ensureCreated: true` to have Aspire create the database on startup if it does not already exist:
+
+
+
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
@@ -131,10 +156,34 @@ builder.AddProject("apiservice")
// After adding all resources, run the app...
```
+
+
+
+```typescript title="apphost.mts"
+import { createBuilder } from './.aspire/modules/aspire.mjs';
+
+const builder = await createBuilder();
+
+const ravenServer = await builder.addRavenDB("ravenServer");
+const ravendb = await ravenServer.addDatabase("ravendb", { ensureCreated: true });
+
+const apiService = await builder.addProject("apiservice", "../ExampleProject/ExampleProject.csproj")
+ .withReference(ravendb)
+ .waitFor(ravendb);
+
+// After adding all resources, run the app...
+```
+
+
+
+
## Add RavenDB server resource with data volume
Add a data volume to the RavenDB server resource to persist data outside the lifecycle of its container:
+
+
+
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
@@ -150,12 +199,38 @@ builder.AddProject("apiservice")
// After adding all resources, run the app...
```
+
+
+
+```typescript title="apphost.mts"
+import { createBuilder } from './.aspire/modules/aspire.mjs';
+
+const builder = await createBuilder();
+
+const ravenServer = await builder.addRavenDB("ravenServer")
+ .withDataVolume();
+
+const ravendb = await ravenServer.addDatabase("ravendb");
+
+const apiService = await builder.addProject("apiservice", "../ExampleProject/ExampleProject.csproj")
+ .withReference(ravendb)
+ .waitFor(ravendb);
+
+// After adding all resources, run the app...
+```
+
+
+
+
The data volume is mounted at the `/var/lib/ravendb/data` path in the RavenDB container. When a `name` parameter isn't provided, the name is generated at random. For more information on data volumes and details on why they're preferred over [bind mounts](#add-ravendb-server-resource-with-data-bind-mount), see [Docker docs: Volumes](https://docs.docker.com/engine/storage/volumes).
## Add RavenDB server resource with data bind mount
Add a data bind mount to the RavenDB server resource as an alternative to a named volume:
+
+
+
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
@@ -171,6 +246,29 @@ builder.AddProject("apiservice")
// After adding all resources, run the app...
```
+
+
+
+```typescript title="apphost.mts"
+import { createBuilder } from './.aspire/modules/aspire.mjs';
+
+const builder = await createBuilder();
+
+const ravenServer = await builder.addRavenDB("ravenServer")
+ .withDataBindMount("C:\\RavenDb\\Data");
+
+const ravendb = await ravenServer.addDatabase("ravendb");
+
+const apiService = await builder.addProject("apiservice", "../ExampleProject/ExampleProject.csproj")
+ .withReference(ravendb)
+ .waitFor(ravendb);
+
+// After adding all resources, run the app...
+```
+
+
+
+
Data bind mounts rely on the host machine's filesystem to persist the RavenDB data across container restarts. The data bind mount is mounted at the `C:\RavenDb\Data` on Windows (or the equivalent Unix path) on the host machine in the RavenDB container. For more information on data bind mounts, see [Docker docs: Bind mounts](https://docs.docker.com/engine/storage/bind-mounts).
@@ -181,6 +279,9 @@ Data bind mounts rely on the host machine's filesystem to persist the RavenDB da
Add a named volume for the RavenDB logs directory:
+
+
+
```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);
@@ -197,6 +298,30 @@ builder.AddProject("apiservice")
// After adding all resources, run the app...
```
+
+
+
+```typescript title="apphost.mts"
+import { createBuilder } from './.aspire/modules/aspire.mjs';
+
+const builder = await createBuilder();
+
+const ravenServer = await builder.addRavenDB("ravenServer")
+ .withDataVolume()
+ .withLogVolume();
+
+const ravendb = await ravenServer.addDatabase("ravendb");
+
+const apiService = await builder.addProject("apiservice", "../ExampleProject/ExampleProject.csproj")
+ .withReference(ravendb)
+ .waitFor(ravendb);
+
+// After adding all resources, run the app...
+```
+
+
+
+
The log volume is mounted at the `/var/log/ravendb/logs` path in the RavenDB container. You can also use `WithLogBindMount(source: @"C:\RavenDb\Logs")` to bind-mount a host directory for logs.
## Add secured RavenDB server resource