# ConfigureEnvFile

- Module: [Aspire.Hosting.Docker](/reference/api/go/aspire.hosting.docker.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`DockerComposeEnvironmentResource`](/reference/api/go/aspire.hosting.docker/dockercomposeenvironmentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the captured environment variables for the Docker Compose environment before they are written to the .env file.

## Remarks

This callback is invoked during the prepare phase, allowing programmatic modification of the environment variables
that will be written to the environment-specific `.env` file adjacent to the Docker Compose file.

## Definition

```go
func (DockerComposeEnvironmentResource) ConfigureEnvFile(configure func(obj *Dict[string, CapturedEnvironmentVariable])) DockerComposeEnvironmentResource
```

## Parameters

- `configure` (`func(obj *Dict[string, CapturedEnvironmentVariable])`) -- A method that can be used for customizing the captured environment variables.

## Returns

[`DockerComposeEnvironmentResource`](/reference/api/go/aspire.hosting.docker/dockercomposeenvironmentresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`DockerComposeEnvironmentResource`](/reference/api/go/aspire.hosting.docker/dockercomposeenvironmentresource.md)
