Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class OllamaContainer extends GenericContainer<OllamaContainer> {

private static final DockerImageName DOCKER_IMAGE_NAME = DockerImageName.parse("ollama/ollama");

private static final int OLLAMA_PORT = 11434;

public OllamaContainer(String image) {
this(DockerImageName.parse(image));
}
Expand All @@ -49,7 +51,7 @@ public OllamaContainer(DockerImageName dockerImageName) {
});
}
}
withExposedPorts(11434);
withExposedPorts(OLLAMA_PORT);
}

/**
Expand All @@ -74,7 +76,11 @@ public void commitToImage(String imageName) {
}
}

public int getPort() {
return getMappedPort(OLLAMA_PORT);
}

public String getEndpoint() {
return "http://" + getHost() + ":" + getMappedPort(11434);
return "http://" + getHost() + ":" + getPort();
}
}
Loading