File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
modules/ollama/src/main/java/org/testcontainers/ollama Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2323public class OllamaContainer extends GenericContainer <OllamaContainer > {
2424
2525 private static final DockerImageName DOCKER_IMAGE_NAME = DockerImageName .parse ("ollama/ollama" );
26+ private static final int OLLAMA_PORT = 11434 ;
2627
2728 public OllamaContainer (String image ) {
2829 this (DockerImageName .parse (image ));
@@ -49,7 +50,7 @@ public OllamaContainer(DockerImageName dockerImageName) {
4950 });
5051 }
5152 }
52- withExposedPorts (11434 );
53+ withExposedPorts (OLLAMA_PORT );
5354 }
5455
5556 /**
@@ -74,7 +75,11 @@ public void commitToImage(String imageName) {
7475 }
7576 }
7677
78+ public int getPort () {
79+ return getMappedPort (OLLAMA_PORT );
80+ }
81+
7782 public String getEndpoint () {
78- return "http://" + getHost () + ":" + getMappedPort ( 11434 );
83+ return "http://" + getHost () + ":" + getPort ( );
7984 }
8085}
You can’t perform that action at this time.
0 commit comments