@testcontainers/chromadb
Version:
ChromaDB module for Testcontainers
29 lines • 1.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StartedChromaDBContainer = exports.ChromaDBContainer = void 0;
const testcontainers_1 = require("testcontainers");
const CHROMADB_PORT = 8000;
class ChromaDBContainer extends testcontainers_1.GenericContainer {
constructor(image) {
super(image);
this.withExposedPorts(CHROMADB_PORT)
.withWaitStrategy(testcontainers_1.Wait.forHttp("/api/v2/heartbeat", CHROMADB_PORT))
.withStartupTimeout(120_000);
}
async start() {
return new StartedChromaDBContainer(await super.start());
}
}
exports.ChromaDBContainer = ChromaDBContainer;
class StartedChromaDBContainer extends testcontainers_1.AbstractStartedContainer {
host;
constructor(startedTestContainer) {
super(startedTestContainer);
this.host = this.startedTestContainer.getHost();
}
getHttpUrl() {
return `http://${this.host}:${this.startedTestContainer.getMappedPort(CHROMADB_PORT)}`;
}
}
exports.StartedChromaDBContainer = StartedChromaDBContainer;
//# sourceMappingURL=chromadb-container.js.map