# DockerComposeEnvironmentResource.ConfigureEnvFile

- Module: [Aspire.Hosting.Docker](/reference/api/go/aspire.hosting.docker.md)
- Defined on: [DockerComposeEnvironmentResource](/reference/api/go/aspire.hosting.docker/dockercomposeenvironmentresource.md)
- Version: `17.0.0`
- Kind: `method`

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
type DockerComposeEnvironmentResource interface {
    // ... omitted for brevity
    ConfigureEnvFile(configure func(obj *Dict[string, CapturedEnvironmentVariable])) DockerComposeEnvironmentResource
}
```

## Signature

```go
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()`.

## Defined on

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