-
-
Notifications
You must be signed in to change notification settings - Fork 252
Description
We have simple use case: We want to spin up some background containers (like a database or a file storage) to run our test against it. The test are cleaning the containers as they need. These containers should be reused on every test run so we save time in every TDD cycle.
We define these containers in a docker-compose.yml and use the docker-compose cli with docker-compose up.
docker-compose up reuses the container everytime with the option --no-recreate.
This approach is working fine.
If we try that with testcontainers we get everytime the error that the containers are already existing.
const composeFilePath = path.resolve(__dirname, "dir-containing-docker-compose-yml");
const composeFile = "docker-compose.yml";
const await new DockerComposeEnvironment(composeFilePath, composeFile).up();According to the docs its also not possible to pass in options like --no-recreate.
Is testcontainers made to serve our usecase? Or should we stick to the raw docker-compose cli?