Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions src/frontend/src/content/docs/integrations/compute/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,29 @@ The preceding code:
When a Docker Compose environment is present, all resources are automatically published as Docker Compose services — no additional opt-in is required.

<Aside type="tip">
With the `compose` variable assigned, you can pass that to the
`WithComputeEnvironment` API to disambiguate compute resources for solutions
that define more than one. Otherwise, the `compose` variable isn't required.
With the `compose` variable assigned, you can pass it to the `WithComputeEnvironment` API to
disambiguate compute resources for solutions that define more than one. Otherwise, the `compose`
variable isn't required. This API is available in C# and polyglot (TypeScript, Python, Java,
Go) app hosts.
Comment on lines +145 to +148

<Tabs syncKey='aspire-lang'>
<TabItem id='csharp' label='C#'>
```csharp title="AppHost.cs"
var compose = builder.AddDockerComposeEnvironment("compose");

builder.AddProject<Projects.MyApi>("api")
.WithComputeEnvironment(compose);
```
</TabItem>
<TabItem id='typescript' label='TypeScript'>
```typescript title="apphost.ts"
const compose = await builder.addDockerComposeEnvironment("compose");

const api = await builder.addContainer("api", "nginx:alpine");
await api.withComputeEnvironment(compose);
```
</TabItem>
</Tabs>
</Aside>

### Add Docker Compose environment resource with properties
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,29 @@ await builder.build().run();
</Tabs>

<Aside type="tip">
With the `k8s` variable assigned, you can pass that to the
`WithComputeEnvironment` API to disambiguate compute resources for solutions
that define more than one. Otherwise, the `k8s` variable isn't required.
With the `k8s` variable assigned, you can pass it to the `WithComputeEnvironment` API to
disambiguate compute resources for solutions that define more than one. Otherwise, the `k8s`
variable isn't required. This API is available in C# and polyglot (TypeScript, Python, Java,
Go) app hosts.
Comment on lines +110 to +113

<Tabs syncKey="aspire-lang">
<TabItem id="csharp" label="C#">
```csharp title="AppHost.cs"
var k8s = builder.AddKubernetesEnvironment("k8s");

builder.AddProject<Projects.MyApi>("api")
.WithComputeEnvironment(k8s);
```
</TabItem>
<TabItem id="typescript" label="TypeScript">
```typescript title="apphost.ts"
const k8s = await builder.addKubernetesEnvironment('k8s');

const api = await builder.addNodeApp('api', './api', 'src/index.ts');
await api.withComputeEnvironment(k8s);
```
</TabItem>
</Tabs>
</Aside>

## Configure Helm chart options
Expand Down
Loading