Created
September 30, 2020 08:45
-
-
Save oguzhancagliyan/2ab0e00f7092ea00cb25f5f5ba434eef to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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