# Custom Docker Feature Configuration

SanteDB typically uses the configuration file and the `IFeature` mechanism for advanced configurations. However, SanteDB also runs within Docker and Kubernetes environments. These are configured using the `IDockerFeature` interface.&#x20;

For example, to expose `FOO` as a feature on the `SDB_FEATURE` and provide a parameter called `BAR` which is leveraging the application settings part of the configuration file:

```csharp
/// <summary>
/// A sample docker feature
/// </summary>
public class FooDockerFeature : IDockerFeature
{

    public const string FooBarSetting = "BAR";

    /// <summary>
    /// This is the feature ID on the SDB_FEATURE
    /// </summary>
    public string Id => "FOO";

    /// <summary>
    /// Settings for the foobar feature
    /// </summary>
    public IEnumerable<string> Settings => new String[] { FooBarSetting };

    /// <summary>
    /// Configure this service
    /// </summary>
    public void Configure(SanteDBConfiguration configuration, IDictionary<string, string> settings)
    {

        // We can fetch the settings for our feature (parsed from docker 
        // environment) with the settings parameter
        if (!settings.TryGetValue(FooBarSetting, out string fooBar))
        {
            fooBar = "Hello World!";
        }
        
        // Set my settings
        configuration.AddSection(new FooBarConfigurationSection() {
            Bar = fooBar
        });
        
        // Add foobar services
        var serviceConfiguration = configuration.GetSection<ApplicationServiceContextConfigurationSection>().ServiceProviders;
        serviceConfiguration.Add(new TypeReferenceConfiguration(typeof(FooBarService)));
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.santesuite.org/developers/server-plugins/implementing-.net-features/configuration/custom-docker-feature-configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
