Skip to content

Commit

Permalink
Use withTmpFs in Mongo testcontainers
Browse files Browse the repository at this point in the history
  • Loading branch information
prdoyle committed Jan 31, 2025
1 parent 245b2bd commit 0cee8d7
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import java.io.Closeable;
import java.util.Map;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -72,6 +73,7 @@ private static GenericContainer<?> mongoContainer() {
.run("echo \"rs.initiate()\" > /docker-entrypoint-initdb.d/rs-initiate.js")
.cmd("mongod", "--replSet", "rsLonesome", "--port", "27017", "--bind_ip_all")
.build()))
.withTmpFs(Map.of("/data/db", "rw"))
.withNetwork(NETWORK)
.withExposedPorts(27017);
result.start();
Expand Down

0 comments on commit 0cee8d7

Please sign in to comment.