Skip to content

Instantly share code, notes, and snippets.

@oguzhancagliyan
Created September 30, 2020 08:45
Show Gist options
  • Save oguzhancagliyan/2ab0e00f7092ea00cb25f5f5ba434eef to your computer and use it in GitHub Desktop.
Save oguzhancagliyan/2ab0e00f7092ea00cb25f5f5ba434eef to your computer and use it in GitHub Desktop.
public class LocalStackFixture : IAsyncLifetime
{
private readonly TestcontainersContainer _localStackContainer;
public LocalStackFixture()
{
var localStackBuilder = new TestcontainersBuilder<TestcontainersContainer>()
.WithImage("localstack/localstack")
.WithCleanUp(true)
.WithEnvironment("DEFAULT_REGION", "eu-central-1")
.WithEnvironment("SERVICES", "dynamodb,sqs")
.WithEnvironment("DOCKER_HOST", "unix:///var/run/docker.sock")
.WithEnvironment("DEBUG", "1")
.WithPortBinding(4566, 4566);
_localStackContainer = localStackBuilder.Build();
}
public async Task InitializeAsync()
{
await _localStackContainer.StartAsync();
}
public async Task DisposeAsync()
{
await _localStackContainer.StopAsync();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment