├── .devcontainer
└── devcontainer.json
├── .github
├── FUNDING.yml
├── ISSUE_TEMPLATE
│ └── bug_report.md
├── actions
│ ├── colima-setup
│ │ └── action.yml
│ ├── docker-rootless-setup
│ │ └── action.yml
│ ├── npm-setup
│ │ └── action.yml
│ ├── podman-setup
│ │ └── action.yml
│ └── rancher-desktop-setup
│ │ └── action.yml
├── dependabot.yml
├── release-drafter.yml
├── scripts
│ └── changed-modules.sh
└── workflows
│ ├── checks.yml
│ ├── codeql-analysis.yml
│ ├── dependency-review.yml
│ ├── npm-publish.yml
│ ├── release-drafter.yml
│ ├── test-template.yml
│ ├── windows-test-command-dispatch.yml
│ └── windows-test.yml
├── .gitignore
├── .husky
└── pre-commit
├── .npmignore
├── .npmrc
├── .nvmrc
├── .prettierignore
├── .prettierrc
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── docker-compose.yml
├── docs
├── configuration.md
├── features
│ ├── advanced.md
│ ├── compose.md
│ ├── containers.md
│ ├── images.md
│ ├── networking.md
│ └── wait-strategies.md
├── index.md
├── modules
│ ├── arangodb.md
│ ├── azurite.md
│ ├── cassandra.md
│ ├── chromadb.md
│ ├── clickhouse.md
│ ├── cockroachdb.md
│ ├── cosmosdb.md
│ ├── couchbase.md
│ ├── elasticsearch.md
│ ├── etcd.md
│ ├── gcloud.md
│ ├── hivemq.md
│ ├── k3s.md
│ ├── kafka.md
│ ├── kurrentdb.md
│ ├── localstack.md
│ ├── mariadb.md
│ ├── minio.md
│ ├── mockserver.md
│ ├── mongodb.md
│ ├── mssqlserver.md
│ ├── mysql.md
│ ├── nats.md
│ ├── neo4j.md
│ ├── ollama.md
│ ├── opensearch.md
│ ├── postgresql.md
│ ├── qdrant.md
│ ├── rabbitmq.md
│ ├── redis.md
│ ├── redpanda.md
│ ├── scylladb.md
│ ├── selenium.md
│ ├── toxiproxy.md
│ ├── valkey.md
│ └── weaviate.md
├── quickstart
│ ├── global-setup.md
│ ├── install.md
│ ├── logging.md
│ └── usage.md
├── site
│ ├── community-logos
│ │ ├── github.svg
│ │ ├── slack.svg
│ │ ├── stackoverflow.svg
│ │ └── twitter.svg
│ ├── css
│ │ ├── extra.css
│ │ └── tc-header.css
│ ├── favicon.ico
│ ├── js
│ │ └── tc-header.js
│ ├── language-logos
│ │ ├── clojure.svg
│ │ ├── dotnet.svg
│ │ ├── elixir.svg
│ │ ├── go.svg
│ │ ├── haskell.svg
│ │ ├── java.svg
│ │ ├── nodejs.svg
│ │ ├── php.svg
│ │ ├── python.svg
│ │ ├── ruby.svg
│ │ ├── rust.svg
│ │ └── scala.svg
│ ├── logo.png
│ ├── logo.svg
│ ├── testcontainers-logo.svg
│ └── theme
│ │ ├── main.html
│ │ └── partials
│ │ ├── header.html
│ │ ├── nav.html
│ │ └── tc-header.html
└── supported-container-runtimes.md
├── eslint.config.js
├── mkdocs.yml
├── package-lock.json
├── package.json
├── packages
├── modules
│ ├── arangodb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── arangodb-container.test.ts
│ │ │ ├── arangodb-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── azurecosmosdb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── azure-cosmosdb-emulator-container.test.ts
│ │ │ ├── azure-cosmosdb-emulator-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── azurite
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── azurite-container.test.ts
│ │ │ ├── azurite-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── cassandra
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── cassandra-container.test.ts
│ │ │ ├── cassandra-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── chromadb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── chromadb-container.test.ts
│ │ │ ├── chromadb-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── clickhouse
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── clickhouse-container.test.ts
│ │ │ ├── clickhouse-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── cockroachdb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── cockroachdb-container.test.ts
│ │ │ ├── cockroachdb-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── couchbase
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── bucket-definition.ts
│ │ │ ├── couchbase-container.test.ts
│ │ │ ├── couchbase-container.ts
│ │ │ ├── couchbase-service.ts
│ │ │ ├── index.ts
│ │ │ └── ports.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── elasticsearch
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── elasticsearch-container.test.ts
│ │ │ ├── elasticsearch-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── etcd
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── etcd-container.test.ts
│ │ │ ├── etcd-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── gcloud
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── abstract-gcloud-emulator.ts
│ │ │ ├── bigquery-emulator-container.test.ts
│ │ │ ├── bigquery-emulator-container.ts
│ │ │ ├── cloudstorage-emulator-container.test.ts
│ │ │ ├── cloudstorage-emulator-container.ts
│ │ │ ├── datastore-emulator-container.test.ts
│ │ │ ├── datastore-emulator-container.ts
│ │ │ ├── emulator-flags-manager.test.ts
│ │ │ ├── emulator-flags-manager.ts
│ │ │ ├── firestore-emulator-container.test.ts
│ │ │ ├── firestore-emulator-container.ts
│ │ │ ├── index.ts
│ │ │ ├── pubsub-emulator-container.test.ts
│ │ │ └── pubsub-emulator-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── hivemq
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── hivemq-container.test.ts
│ │ │ ├── hivemq-container.ts
│ │ │ └── index.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── k3s
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── k3s-container.test.ts
│ │ │ └── k3s-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── kafka
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── kafka-container-7.test.ts
│ │ │ ├── kafka-container-latest.test.ts
│ │ │ ├── kafka-container.ts
│ │ │ └── test-helper.ts
│ │ ├── test-certs
│ │ │ ├── .gitignore
│ │ │ ├── Dockerfile
│ │ │ ├── README.md
│ │ │ ├── generate-certs.sh
│ │ │ ├── kafka.client.truststore.pem
│ │ │ ├── kafka.server.keystore.pfx
│ │ │ └── kafka.server.truststore.pfx
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── kurrentdb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── kurrentdb-container.test.ts
│ │ │ └── kurrentdb-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── localstack
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── localstack-container.test.ts
│ │ │ └── localstack-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── mariadb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── mariadb-container.test.ts
│ │ │ └── mariadb-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── minio
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── dummy-file.txt
│ │ │ ├── index.ts
│ │ │ ├── minio-container.test.ts
│ │ │ └── minio-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── mockserver
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── mockserver-container.test.ts
│ │ │ └── mockserver-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── mongodb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── mongodb-container.test.ts
│ │ │ └── mongodb-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── mssqlserver
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── mssqlserver-container.test.ts
│ │ │ └── mssqlserver-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── mysql
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── mysql-container.test.ts
│ │ │ └── mysql-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── nats
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── nats-container.test.ts
│ │ │ └── nats-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── neo4j
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── neo4j-container.test.ts
│ │ │ └── neo4j-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── ollama
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── ollama-container.test.ts
│ │ │ └── ollama-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── opensearch
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── opensearch-container.test.ts
│ │ │ └── opensearch-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── postgresql
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── pgvector-container.test.ts
│ │ │ ├── postgis-container.test.ts
│ │ │ ├── postgresql-container-snapshot.test.ts
│ │ │ ├── postgresql-container.test.ts
│ │ │ ├── postgresql-container.ts
│ │ │ └── timescale-container.test.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── qdrant
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── qdrant-container.test.ts
│ │ │ ├── qdrant-container.ts
│ │ │ └── test_config.yaml
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── rabbitmq
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── rabbitmq-container.test.ts
│ │ │ └── rabbitmq-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── redis
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── import.sh
│ │ │ ├── index.ts
│ │ │ ├── initData.redis
│ │ │ ├── redis-container.test.ts
│ │ │ └── redis-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── redpanda
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── assets
│ │ │ │ ├── bootstrap.yaml
│ │ │ │ └── redpanda.yaml.hbs
│ │ │ ├── index.ts
│ │ │ ├── redpanda-container.test.ts
│ │ │ └── redpanda-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── scylladb
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── scylladb-container.test.ts
│ │ │ └── scylladb-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── selenium
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── selenium-container.test.ts
│ │ │ └── selenium-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── toxiproxy
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── index.ts
│ │ │ ├── toxiproxy-container.test.ts
│ │ │ └── toxiproxy-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ ├── valkey
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ │ ├── import.sh
│ │ │ ├── index.ts
│ │ │ ├── initData.valkey
│ │ │ ├── valkey-container.test.ts
│ │ │ └── valkey-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
│ └── weaviate
│ │ ├── Dockerfile
│ │ ├── package.json
│ │ ├── src
│ │ ├── index.ts
│ │ ├── weaviate-container.test.ts
│ │ └── weaviate-container.ts
│ │ ├── tsconfig.build.json
│ │ └── tsconfig.json
└── testcontainers
│ ├── fixtures
│ ├── docker-compose
│ │ ├── docker-compose-malformed.yml
│ │ ├── docker-compose-with-buildkit
│ │ │ ├── Dockerfile
│ │ │ ├── docker-compose.yml
│ │ │ └── index.js
│ │ ├── docker-compose-with-env-file
│ │ │ ├── .env
│ │ │ ├── .env.override
│ │ │ └── docker-compose.yml
│ │ ├── docker-compose-with-env.yml
│ │ ├── docker-compose-with-healthcheck-unhealthy.yml
│ │ ├── docker-compose-with-healthcheck-with-start-period.yml
│ │ ├── docker-compose-with-healthcheck.yml
│ │ ├── docker-compose-with-many-services.yml
│ │ ├── docker-compose-with-name.yml
│ │ ├── docker-compose-with-override
│ │ │ ├── docker-compose-update.yml
│ │ │ └── docker-compose.yml
│ │ ├── docker-compose-with-private-port.yml
│ │ ├── docker-compose-with-profile.yml
│ │ ├── docker-compose-with-volume.yml
│ │ └── docker-compose.yml
│ └── docker
│ │ ├── docker-exit-immediately
│ │ └── Dockerfile
│ │ ├── docker-multi-stage
│ │ └── Dockerfile
│ │ ├── docker-with-buildargs
│ │ ├── Dockerfile
│ │ └── index.js
│ │ ├── docker-with-buildkit
│ │ ├── Dockerfile
│ │ └── index.js
│ │ ├── docker-with-custom-filename
│ │ ├── Dockerfile-A
│ │ └── index.js
│ │ ├── docker-with-dockerignore
│ │ ├── .dockerignore
│ │ ├── Dockerfile
│ │ ├── example1.txt
│ │ ├── example2
│ │ │ └── example2.txt
│ │ ├── example3
│ │ │ └── example3.txt
│ │ ├── example4
│ │ │ └── nested
│ │ │ │ └── example4.txt
│ │ ├── example5
│ │ │ └── example5.txt
│ │ ├── example6
│ │ │ ├── example6.txt
│ │ │ └── exist2.txt
│ │ ├── example7
│ │ │ ├── example7.txt
│ │ │ └── exist7.txt
│ │ ├── exist1.txt
│ │ └── index.js
│ │ ├── docker-with-health-check-with-start-period
│ │ ├── Dockerfile
│ │ └── index.js
│ │ ├── docker-with-health-check
│ │ ├── Dockerfile
│ │ └── index.js
│ │ ├── docker
│ │ ├── Dockerfile
│ │ ├── index.js
│ │ └── test.txt
│ │ └── dockerfile-parser
│ │ ├── Dockerfile
│ │ ├── buildargs.Dockerfile
│ │ ├── formatted.Dockerfile
│ │ ├── multistage-duplicate.Dockerfile
│ │ ├── multistage-naming.Dockerfile
│ │ └── multistage.Dockerfile
│ ├── package.json
│ ├── smoke-test.js
│ ├── smoke-test.mjs
│ ├── src
│ ├── common
│ │ ├── clock.ts
│ │ ├── file-lock.ts
│ │ ├── hash.test.ts
│ │ ├── hash.ts
│ │ ├── index.ts
│ │ ├── logger.ts
│ │ ├── retry.test.ts
│ │ ├── retry.ts
│ │ ├── streams.ts
│ │ ├── time.test.ts
│ │ ├── time.ts
│ │ ├── type-guards.ts
│ │ └── uuid.ts
│ ├── container-runtime
│ │ ├── auth
│ │ │ ├── auths.test.ts
│ │ │ ├── auths.ts
│ │ │ ├── cred-helpers.test.ts
│ │ │ ├── cred-helpers.ts
│ │ │ ├── credential-provider.test.ts
│ │ │ ├── credential-provider.ts
│ │ │ ├── creds-store.test.ts
│ │ │ ├── creds-store.ts
│ │ │ ├── get-auth-config.test.ts
│ │ │ ├── get-auth-config.ts
│ │ │ ├── registry-auth-locator.ts
│ │ │ ├── registry-matches.test.ts
│ │ │ ├── registry-matches.ts
│ │ │ └── types.ts
│ │ ├── clients
│ │ │ ├── client.ts
│ │ │ ├── compose
│ │ │ │ ├── compose-client.ts
│ │ │ │ ├── default-compose-options.ts
│ │ │ │ ├── parse-compose-container-name.test.ts
│ │ │ │ ├── parse-compose-container-name.ts
│ │ │ │ └── types.ts
│ │ │ ├── container
│ │ │ │ ├── container-client.ts
│ │ │ │ ├── docker-container-client.ts
│ │ │ │ └── types.ts
│ │ │ ├── image
│ │ │ │ ├── docker-image-client.ts
│ │ │ │ └── image-client.ts
│ │ │ ├── network
│ │ │ │ ├── docker-network-client.ts
│ │ │ │ └── network-client.ts
│ │ │ └── types.ts
│ │ ├── image-name.test.ts
│ │ ├── image-name.ts
│ │ ├── index.ts
│ │ ├── strategies
│ │ │ ├── configuration-strategy.test.ts
│ │ │ ├── configuration-strategy.ts
│ │ │ ├── npipe-socket-strategy.test.ts
│ │ │ ├── npipe-socket-strategy.ts
│ │ │ ├── rootless-unix-socket-strategy.test.ts
│ │ │ ├── rootless-unix-socket-strategy.ts
│ │ │ ├── strategy.ts
│ │ │ ├── testcontainers-host-strategy.test.ts
│ │ │ ├── testcontainers-host-strategy.ts
│ │ │ ├── types.ts
│ │ │ ├── unix-socket-strategy.test.ts
│ │ │ ├── unix-socket-strategy.ts
│ │ │ └── utils
│ │ │ │ ├── config.test.ts
│ │ │ │ └── config.ts
│ │ └── utils
│ │ │ ├── attach-container.ts
│ │ │ ├── demux-stream.ts
│ │ │ ├── image-exists.test.ts
│ │ │ ├── image-exists.ts
│ │ │ ├── lookup-host-ips.test.ts
│ │ │ ├── lookup-host-ips.ts
│ │ │ ├── pull-image.ts
│ │ │ ├── remote-container-runtime-socket-path.test.ts
│ │ │ ├── remote-container-runtime-socket-path.ts
│ │ │ ├── resolve-host.test.ts
│ │ │ ├── resolve-host.ts
│ │ │ ├── run-in-container.test.ts
│ │ │ ├── run-in-container.ts
│ │ │ └── start-container.ts
│ ├── docker-compose-environment
│ │ ├── docker-compose-environment.test.ts
│ │ ├── docker-compose-environment.ts
│ │ ├── downed-docker-compose-environment.ts
│ │ ├── started-docker-compose-environment.ts
│ │ └── stopped-docker-compose-environment.ts
│ ├── generic-container
│ │ ├── abstract-started-container.ts
│ │ ├── abstract-stopped-container.ts
│ │ ├── generic-container-builder.ts
│ │ ├── generic-container-commit.test.ts
│ │ ├── generic-container-dockerfile.test.ts
│ │ ├── generic-container-lifecycle.test.ts
│ │ ├── generic-container-logs.test.ts
│ │ ├── generic-container-network.test.ts
│ │ ├── generic-container-resources-quota.test.ts
│ │ ├── generic-container-restart.test.ts
│ │ ├── generic-container-reuse.test.ts
│ │ ├── generic-container.test.ts
│ │ ├── generic-container.ts
│ │ ├── inspect-container-util-ports-exposed.test.ts
│ │ ├── inspect-container-util-ports-exposed.ts
│ │ ├── started-generic-container.ts
│ │ └── stopped-generic-container.ts
│ ├── index.ts
│ ├── network
│ │ ├── network.test.ts
│ │ └── network.ts
│ ├── port-forwarder
│ │ ├── port-forwarder-reuse.test.ts
│ │ ├── port-forwarder.test.ts
│ │ └── port-forwarder.ts
│ ├── reaper
│ │ ├── reaper.test.ts
│ │ └── reaper.ts
│ ├── socat
│ │ ├── socat-container.test.ts
│ │ └── socat-container.ts
│ ├── test-container.ts
│ ├── test-containers.ts
│ ├── types.ts
│ ├── utils
│ │ ├── bound-ports.test.ts
│ │ ├── bound-ports.ts
│ │ ├── dockerfile-parser.test.ts
│ │ ├── dockerfile-parser.ts
│ │ ├── labels.ts
│ │ ├── map-inspect-result.ts
│ │ ├── port-generator.test.ts
│ │ ├── port-generator.ts
│ │ ├── port.ts
│ │ ├── pull-policy.test.ts
│ │ ├── pull-policy.ts
│ │ └── test-helper.ts
│ ├── version.ts
│ └── wait-strategies
│ │ ├── composite-wait-strategy.test.ts
│ │ ├── composite-wait-strategy.ts
│ │ ├── health-check-wait-strategy.test.ts
│ │ ├── health-check-wait-strategy.ts
│ │ ├── host-port-wait-strategy.test.ts
│ │ ├── host-port-wait-strategy.ts
│ │ ├── http-wait-strategy.test.ts
│ │ ├── http-wait-strategy.ts
│ │ ├── log-wait-strategy.test.ts
│ │ ├── log-wait-strategy.ts
│ │ ├── one-shot-startup-startegy.test.ts
│ │ ├── one-shot-startup-startegy.ts
│ │ ├── shell-wait-strategy.test.ts
│ │ ├── shell-wait-strategy.ts
│ │ ├── startup-check-strategy.test.ts
│ │ ├── startup-check-strategy.ts
│ │ ├── utils
│ │ ├── port-check.test.ts
│ │ ├── port-check.ts
│ │ ├── undici-response-parser.test.ts
│ │ └── undici-response-parser.ts
│ │ ├── wait-for-container.ts
│ │ ├── wait-strategy.ts
│ │ └── wait.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── requirements.txt
├── runtime.txt
├── sonar-project.properties
├── tsconfig.base.json
└── vitest.config.ts
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [cristianrgreco]
4 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Expected Behaviour**
11 | ...
12 |
13 | **Actual Behaviour**
14 | ...
15 |
16 | **Testcontainer Logs**
17 | ...
18 |
19 | **Steps to Reproduce**
20 | 1. In this environment...
21 | 2. With this config...
22 | 3. Run '...'
23 | 4. See error...
24 |
25 | **Environment Information**
26 | - Operating System:
27 | - Docker Version:
28 | - Node version:
29 | - Testcontainers version:
30 |
--------------------------------------------------------------------------------
/.github/actions/colima-setup/action.yml:
--------------------------------------------------------------------------------
1 | name: "Colima Setup"
2 | description: "Sets up Colima"
3 | inputs:
4 | runner:
5 | description: "The runner type (e.g., macos-latest)"
6 | required: true
7 | runs:
8 | using: "composite"
9 | steps:
10 | - name: Colima constraints
11 | shell: bash
12 | run: |
13 | if [[ ! "${{ inputs.runner }}" =~ ^macos.* ]]; then
14 | echo "::error::Colima is only supported on macOS"
15 | exit 1
16 | fi
17 | - name: Colima setup
18 | shell: bash
19 | run: |
20 | brew install docker docker-compose colima
21 | colima start --cpu 3 --memory 14 --disk 14 --runtime docker
22 | colima status
23 | colima --version
24 | echo "DOCKER_HOST=unix://${HOME}/.colima/default/docker.sock" >> $GITHUB_ENV
25 | echo "TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE=/var/run/docker.sock" >> $GITHUB_ENV
26 | echo "NODE_OPTIONS=--dns-result-order=ipv4first" >> $GITHUB_ENV
27 |
--------------------------------------------------------------------------------
/.github/actions/docker-rootless-setup/action.yml:
--------------------------------------------------------------------------------
1 | name: "Docker Rootless Setup"
2 | description: "Sets up Docker in rootless mode"
3 | runs:
4 | using: "composite"
5 | steps:
6 | - name: Docker rootless setup 1/2
7 | uses: ScribeMD/rootless-docker@0.2.2
8 | - name: Docker rootless setup 2/2
9 | shell: bash
10 | run: |
11 | sudo rm -rf /var/run/docker.sock
12 | echo "CI_ROOTLESS=true" >> $GITHUB_ENV
13 |
--------------------------------------------------------------------------------
/.github/actions/podman-setup/action.yml:
--------------------------------------------------------------------------------
1 | name: "Podman Setup"
2 | description: "Sets up Podman"
3 | runs:
4 | using: "composite"
5 | steps:
6 | - name: Podman setup
7 | shell: bash
8 | run: |
9 | curl -fsSL "https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/Release.key" | gpg --dearmor | sudo tee /etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg > /dev/null
10 | echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/devel_kubic_libcontainers_unstable.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/unstable/xUbuntu_$(lsb_release -rs)/ /" | sudo tee /etc/apt/sources.list.d/devel:kubic:libcontainers:unstable.list > /dev/null
11 | sudo apt-get update
12 | sudo apt-get -y install podman
13 | systemctl enable --now --user podman podman.socket
14 | podman info
15 | echo "DOCKER_HOST=unix://${XDG_RUNTIME_DIR}/podman/podman.sock" >> $GITHUB_ENV
16 | echo "CI_ROOTLESS=true" >> $GITHUB_ENV
17 | echo "CI_PODMAN=true" >> $GITHUB_ENV
18 |
--------------------------------------------------------------------------------
/.github/release-drafter.yml:
--------------------------------------------------------------------------------
1 | name-template: "v$RESOLVED_VERSION"
2 | tag-template: "v$RESOLVED_VERSION"
3 | categories:
4 | - title: "🚀 Features"
5 | labels:
6 | - "enhancement"
7 | - title: "🐛 Bug Fixes"
8 | labels:
9 | - "bug"
10 | - title: "📖 Documentation"
11 | labels:
12 | - "documentation"
13 | - title: "🧹 Maintenance"
14 | labels:
15 | - "maintenance"
16 | - title: "📦 Dependency Updates"
17 | labels:
18 | - "dependencies"
19 | change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
20 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
21 | version-resolver:
22 | major:
23 | labels:
24 | - "major"
25 | minor:
26 | labels:
27 | - "minor"
28 | patch:
29 | labels:
30 | - "patch"
31 | default: patch
32 | template: |
33 | ## Changes
34 |
35 | $CHANGES
36 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | name: "CodeQL"
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | # The branches below must be a subset of the branches above
8 | branches: [main]
9 | schedule:
10 | - cron: "17 5 * * 2"
11 |
12 | jobs:
13 | analyze:
14 | name: Analyze
15 | runs-on: ubuntu-22.04
16 | permissions:
17 | actions: read
18 | contents: read
19 | security-events: write
20 | strategy:
21 | fail-fast: false
22 | matrix:
23 | language: ["javascript"]
24 |
25 | steps:
26 | - name: Checkout repository
27 | uses: actions/checkout@v4
28 | - name: Initialize CodeQL
29 | uses: github/codeql-action/init@v3
30 | with:
31 | languages: ${{ matrix.language }}
32 | - name: Autobuild
33 | uses: github/codeql-action/autobuild@v3
34 | - name: Perform CodeQL Analysis
35 | uses: github/codeql-action/analyze@v3
36 |
--------------------------------------------------------------------------------
/.github/workflows/dependency-review.yml:
--------------------------------------------------------------------------------
1 | name: "Dependency Review"
2 | on: [pull_request]
3 |
4 | permissions:
5 | contents: read
6 |
7 | jobs:
8 | dependency-review:
9 | name: Run
10 | runs-on: ubuntu-latest
11 | steps:
12 | - name: "Checkout Repository"
13 | uses: actions/checkout@v4
14 | - name: "Dependency Review"
15 | uses: actions/dependency-review-action@v4
16 | with:
17 | fail-on-scopes: development
18 |
--------------------------------------------------------------------------------
/.github/workflows/release-drafter.yml:
--------------------------------------------------------------------------------
1 | # https://github.com/release-drafter/release-drafter
2 |
3 | name: Release Drafter
4 |
5 | on:
6 | push:
7 | # branches to consider in the event; optional, defaults to all
8 | branches:
9 | - main
10 |
11 | jobs:
12 | update_release_draft:
13 | runs-on: ubuntu-22.04
14 | steps:
15 | # Drafts your next Release notes as Pull Requests are merged into "main"
16 | - uses: release-drafter/release-drafter@v6
17 | env:
18 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 |
--------------------------------------------------------------------------------
/.github/workflows/windows-test-command-dispatch.yml:
--------------------------------------------------------------------------------
1 | name: windows-test command dispatch
2 |
3 | on:
4 | issue_comment:
5 | types: [created]
6 |
7 | jobs:
8 | windows-test-command-dispatch:
9 | runs-on: ubuntu-22.04
10 |
11 | steps:
12 | - name: Dispatch windows-test command
13 | uses: peter-evans/slash-command-dispatch@v4
14 | with:
15 | token: ${{ secrets.REPO_TOKEN }}
16 | commands: windows-test
17 | issue-type: pull-request
18 | permission: maintain
19 | reactions: false
20 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build/
2 | *.tsbuildinfo
3 | node_modules/
4 | coverage/
5 |
6 | # Package files are copied from the root on pack
7 | packages/**/README.md
8 | packages/**/LICENSE
9 |
10 | # IDEs and editors
11 | /.idea
12 | .project
13 | .classpath
14 | .c9/
15 | *.launch
16 | .settings/
17 | *.sublime-workspace
18 |
19 | # IDE - VSCode
20 | .vscode/*
21 | !.vscode/settings.json
22 | !.vscode/tasks.json
23 | !.vscode/launch.json
24 | !.vscode/extensions.json
25 |
--------------------------------------------------------------------------------
/.husky/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | . "$(dirname "$0")/_/husky.sh"
3 |
4 | npm run pre-commit
5 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/.npmignore
--------------------------------------------------------------------------------
/.npmrc:
--------------------------------------------------------------------------------
1 | engine-strict=true
--------------------------------------------------------------------------------
/.nvmrc:
--------------------------------------------------------------------------------
1 | 24
2 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | **/build/**
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "trailingComma": "es5",
4 | "plugins": ["prettier-plugin-organize-imports"]
5 | }
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 - 2025 Cristian Greco
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | docs:
3 | image: python:3.13
4 | command: sh -c "pip install -r requirements.txt && mkdocs serve -a 0.0.0.0:8000"
5 | working_dir: /docs
6 | volumes:
7 | - ./:/docs
8 | ports:
9 | - 8000:8000
10 |
--------------------------------------------------------------------------------
/docs/modules/arangodb.md:
--------------------------------------------------------------------------------
1 | # ArangoDB Module
2 |
3 | [ArangoDB](https://www.arangodb.com/) is an open source friendly multi-model database. You can find the documentation of the [ArangoDB JavaScript](https://www.arangodb.com/docs/stable/drivers/js.html) driver here.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/arangodb --save-dev
9 | ```
10 |
11 | ## Example
12 |
13 |
14 | [](../../packages/modules/arangodb/src/arangodb-container.test.ts) inside_block:connect
15 |
16 |
17 |
--------------------------------------------------------------------------------
/docs/modules/cassandra.md:
--------------------------------------------------------------------------------
1 | # Cassandra Module
2 |
3 | [Cassandra](https://cassandra.apache.org/_/index.html) is a free and open source, distributed NoSQL database management system. It is designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.
4 |
5 |
6 |
7 | ## Install
8 |
9 | ```bash
10 | npm install @testcontainers/cassandra --save-dev
11 | ```
12 |
13 | ## Examples
14 |
15 |
16 | [Connect:](../../packages/modules/cassandra/src/cassandra-container.test.ts) inside_block:connectWithDefaultCredentials
17 |
18 |
19 |
20 | [Connect with custom credentials:](../../packages/modules/cassandra/src/cassandra-container.test.ts) inside_block:connectWithCustomCredentials
21 |
22 |
23 |
24 | [With custom datacenter / rack](../../packages/modules/cassandra/src/cassandra-container.test.ts) inside_block:customDataCenterAndRack
25 |
26 |
27 |
28 | [Insert & fetch data:](../../packages/modules/cassandra/src/cassandra-container.test.ts) inside_block:createAndFetchData
29 |
30 |
--------------------------------------------------------------------------------
/docs/modules/cockroachdb.md:
--------------------------------------------------------------------------------
1 | # CockroachDB Module
2 |
3 | [CockroachDB](https://github.com/cockroachdb/cockroach) is a cloud-native, postgresql compatible, distributed SQL database designed to build, scale, and manage modern, data-intensive applications.
4 |
5 |
6 | ## Install
7 |
8 | ```bash
9 | npm install @testcontainers/cockroachdb --save-dev
10 | ```
11 |
12 | ## Examples
13 |
14 |
15 | [Connect and execute query:](../../packages/modules/cockroachdb/src/cockroachdb-container.test.ts) inside_block:connect
16 |
17 |
18 |
19 | [Connect and execute query using URI:](../../packages/modules/cockroachdb/src/cockroachdb-container.test.ts) inside_block:uriConnect
20 |
21 |
22 |
23 | [Set database:](../../packages/modules/cockroachdb/src/cockroachdb-container.test.ts) inside_block:setDatabase
24 |
25 |
26 |
27 | [Set username:](../../packages/modules/cockroachdb/src/cockroachdb-container.test.ts) inside_block:setUsername
28 |
29 |
--------------------------------------------------------------------------------
/docs/modules/couchbase.md:
--------------------------------------------------------------------------------
1 | # Couchbase Module
2 |
3 | [Couchbase](https://www.couchbase.com/) is a distributed document database with a powerful search engine and in-built operational and analytical capabilities. It brings the power of NoSQL to the edge and provides fast, efficient bidirectional synchronization of data between the edge and the cloud.
4 |
5 |
6 | ## Install
7 |
8 | ```bash
9 | npm install @testcontainers/couchbase --save-dev
10 | ```
11 |
12 | ## Examples
13 |
14 |
15 | [upsertAndGet:](../../packages/modules/couchbase/src/couchbase-container.test.ts) inside_block:upsertAndGet
16 |
17 |
18 |
19 | [Connect and execute query:](../../packages/modules/couchbase/src/couchbase-container.test.ts) inside_block:connectAndQuery
20 |
21 |
--------------------------------------------------------------------------------
/docs/modules/elasticsearch.md:
--------------------------------------------------------------------------------
1 | # Elasticsearch Module
2 |
3 | [Elasticsearch](https://www.elastic.co/elasticsearch/) is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/elasticsearch --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Create an index:](../../packages/modules/elasticsearch/src/elasticsearch-container.test.ts) inside_block:createIndex
15 |
16 |
17 |
18 | [Index a document:](../../packages/modules/elasticsearch/src/elasticsearch-container.test.ts) inside_block:indexDocument
19 |
20 |
--------------------------------------------------------------------------------
/docs/modules/etcd.md:
--------------------------------------------------------------------------------
1 | # Etcd Module
2 |
3 | [Etcd](https://etcd.io/) is a strongly consistent, distributed key-value store that provides a reliable way to store data that needs to be accessed by a distributed system or cluster of machines.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/etcd --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Read and write key-value pairs:](../../packages/modules/etcd/src/etcd-container.test.ts) inside_block:readWrite
15 |
16 |
17 |
18 | [Subscribe to key changes:](../../packages/modules/etcd/src/etcd-container.test.ts) inside_block:subscribe
19 |
20 |
--------------------------------------------------------------------------------
/docs/modules/hivemq.md:
--------------------------------------------------------------------------------
1 | # HiveMQ MQTT Module
2 |
3 | This module allows automatic start up of [HiveMQ's](https://www.hivemq.com/) docker container within
4 | test suites, to enable programmatic testing of JavaScript based MQTT client applications.
5 |
6 | ## Install
7 |
8 | ```bash
9 | npm install @testcontainers/hivemq --save-dev
10 | ```
11 |
12 | ## Resources
13 |
14 | - [Community forum](https://community.hivemq.com/)
15 | - [HiveMQ website](https://www.hivemq.com/)
16 | - [MQTT Essentials](https://www.hivemq.com/mqtt-essentials/)
17 | - [MQTT 5 Essentials](https://www.hivemq.com/mqtt-5/)
18 |
19 | Please make sure to check out the hivemq-docs for the [Community Edition](https://github.com/hivemq/hivemq-community-edition/wiki/).
20 |
21 | !!! Info
22 | We are working to support the HiveMQ Enterprise Edition as outlined in the [Java Test Containers Module](https://java.testcontainers.org/modules/hivemq/).
23 |
24 | ## Examples
25 |
26 |
27 |
28 | [Connect with a mqtt.js client to HiveMQ](../../packages/modules/hivemq/src/hivemq-container.test.ts) inside_block:connect
29 |
30 |
31 |
--------------------------------------------------------------------------------
/docs/modules/k3s.md:
--------------------------------------------------------------------------------
1 | # K3s Module
2 |
3 | [K3s](https://k3s.io/) is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/k3s --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Starting a K3s server:](../../packages/modules/k3s/src/k3s-container.test.ts) inside_block:starting_k3s
15 |
16 |
17 |
18 | [Connecting to the server using the Kubernetes JavaScript client:](../../packages/modules/k3s/src/k3s-container.test.ts) inside_block:connecting_with_client
19 |
20 |
21 | ## Known limitations
22 |
23 | !!! warning
24 | * K3sContainer runs as a privileged container and needs to be able to spawn its own containers. For these reasons,
25 | K3sContainer will not work in certain rootless Docker, Docker-in-Docker, or other environments where privileged
26 | containers are disallowed.
27 |
--------------------------------------------------------------------------------
/docs/modules/kurrentdb.md:
--------------------------------------------------------------------------------
1 | # KurrentDB Module
2 |
3 | [KurrentDB](https://kurrent.io) is an event sourcing database that stores data in streams of immutable events.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/kurrentdb --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Start container:](../../packages/modules/kurrentdb/src/kurrentdb-container.test.ts) inside_block:startContainer
15 |
16 |
17 |
18 | [Subscribe to standard projection:](../../packages/modules/kurrentdb/src/kurrentdb-container.test.ts) inside_block:usingStandardProjections
19 |
20 |
--------------------------------------------------------------------------------
/docs/modules/localstack.md:
--------------------------------------------------------------------------------
1 | # Localstack Module
2 |
3 | [Localstack](https://www.localstack.cloud/): Develop and test your AWS applications locally to reduce development time and increase product velocity
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/localstack --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Create a S3 bucket:](../../packages/modules/localstack/src/localstack-container.test.ts) inside_block:createS3Bucket
15 |
16 |
--------------------------------------------------------------------------------
/docs/modules/mariadb.md:
--------------------------------------------------------------------------------
1 | # MariaDB Module
2 |
3 | [MariaDB](https://mariadb.org/) is one of the most popular open source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions.
4 |
5 |
6 |
7 | ## Install
8 |
9 | ```bash
10 | npm install @testcontainers/mariadb --save-dev
11 | ```
12 |
13 | ## Examples
14 |
15 |
16 | [Connect and execute query:](../../packages/modules/mariadb/src/mariadb-container.test.ts) inside_block:connect
17 |
18 |
19 |
20 | [Connect and execute query using URI:](../../packages/modules/mariadb/src/mariadb-container.test.ts) inside_block:uriConnect
21 |
22 |
23 |
24 | [Set username:](../../packages/modules/mariadb/src/mariadb-container.test.ts) inside_block:setUsername
25 |
26 |
27 |
28 | [Insert & fetch data:](../../packages/modules/mariadb/src/mariadb-container.test.ts) inside_block:insertAndFetchData
29 |
30 |
--------------------------------------------------------------------------------
/docs/modules/minio.md:
--------------------------------------------------------------------------------
1 | # MinIO Module
2 |
3 | [MinIO](https://min.io/) is a high performance object storage solution. It is API compatible with the Amazon S3 cloud storage service and can handle unstructured data such as photos, videos, log files, backups, and container images
4 |
5 |
6 |
7 | ## Install
8 |
9 | ```bash
10 | npm install @testcontainers/minio --save-dev
11 | ```
12 |
13 | ## Examples
14 |
15 |
16 | [Connect with default credentials:](../../packages/modules/minio/src/minio-container.test.ts) inside_block:connectWithDefaultCredentials
17 |
18 |
19 |
20 | [Connect with custom credentials:](../../packages/modules/minio/src/minio-container.test.ts) inside_block:connectWithCustomCredentials
21 |
22 |
--------------------------------------------------------------------------------
/docs/modules/mockserver.md:
--------------------------------------------------------------------------------
1 | # Mockserver Module
2 |
3 | [MockServer](https://www.mock-server.com/#what-is-mockserver) allows you to mock any server or service via HTTP or HTTPS, such as a REST or RPC service.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/mockserver --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Start container:](../../packages/modules/mockserver/src/mockserver-container.test.ts) inside_block:startContainer
15 |
16 |
17 | MockServer includes built-in TLS support. To obtain an HTTPS URL, use the `getSecureUrl` method. Keep in mind that MockServer uses a self-signed certificate.
18 |
19 |
20 | [Using TLS:](../../packages/modules/mockserver/src/mockserver-container.test.ts) inside_block:httpsRequests
21 |
--------------------------------------------------------------------------------
/docs/modules/mongodb.md:
--------------------------------------------------------------------------------
1 | # MongoDB Module
2 |
3 | [MongoDB](https://www.mongodb.com/) is an open source NoSQL database management program. NoSQL is used as an alternative to traditional relational databases. NoSQL databases are quite useful for working with large sets of distributed data. MongoDB is a tool that can manage document-oriented information, store or retrieve information.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/mongodb --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Mongo 4.0.x:](../../packages/modules/mongodb/src/mongodb-container.test.ts) inside_block:connect4
15 |
16 |
17 |
18 | [MongoDB 6.0.x:](../../packages/modules/mongodb/src/mongodb-container.test.ts) inside_block:connect6
19 |
20 |
--------------------------------------------------------------------------------
/docs/modules/nats.md:
--------------------------------------------------------------------------------
1 | # Nats Module
2 |
3 | [NATS](https://nats.io/) is a simple, secure and high performance open source messaging system for cloud native applications, IoT messaging, and microservices architectures.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/nats --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Connect:](../../packages/modules/nats/src/nats-container.test.ts) inside_block:connect
15 |
16 |
17 |
18 | [Publish and subscribe:](../../packages/modules/nats/src/nats-container.test.ts) inside_block:pubsub
19 |
20 |
21 |
22 | [Set credentials:](../../packages/modules/nats/src/nats-container.test.ts) inside_block:credentials
23 |
24 |
25 |
26 | [Enable JetStream:](../../packages/modules/nats/src/nats-container.test.ts) inside_block:jetstream
27 |
--------------------------------------------------------------------------------
/docs/modules/neo4j.md:
--------------------------------------------------------------------------------
1 | # Neo4j Module
2 |
3 | [Neo4j](https://neo4j.com/) is a highly scalable, robust native graph database.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/neo4j --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Connect and create a node:](../../packages/modules/neo4j/src/neo4j-container.test.ts) inside_block:createNode
15 |
16 |
17 |
18 | [Set password:](../../packages/modules/neo4j/src/neo4j-container.test.ts) inside_block:setPassword
19 |
20 |
21 |
22 | [Configure APOC:](../../packages/modules/neo4j/src/neo4j-container.test.ts) inside_block:apoc
23 |
24 |
25 |
26 | [Configure other supported plugins:](../../packages/modules/neo4j/src/neo4j-container.test.ts) inside_block:pluginsList
27 |
28 |
--------------------------------------------------------------------------------
/docs/modules/ollama.md:
--------------------------------------------------------------------------------
1 | # Ollama
2 |
3 | Testcontainers module for [Ollama](https://hub.docker.com/r/ollama/ollama) .
4 |
5 | ## Ollama usage examples
6 |
7 | You can start an Ollama container instance from any NodeJS application by using:
8 |
9 |
10 | [Ollama container](../../packages/modules/ollama/src/ollama-container.test.ts) inside_block:container
11 |
12 |
13 | ### Pulling the model
14 |
15 |
16 | [Pull model](../../packages/modules/ollama/src/ollama-container.test.ts) inside_block:pullModel
17 |
18 |
19 | ### Create a new Image
20 |
21 | In order to create a new image that contains the model, you can use the following code:
22 |
23 |
24 | [Commit Image](../../packages/modules/ollama/src/ollama-container.test.ts) inside_block:commitToImage
25 |
26 |
27 | And use the new image:
28 |
29 |
30 | [Use new Image](../../packages/modules/ollama/src/ollama-container.test.ts) inside_block:substitute
31 |
32 |
33 | ## Adding this module to your project
34 |
35 | ```bash
36 | npm install @testcontainers/ollama --save-dev
37 | ```
--------------------------------------------------------------------------------
/docs/modules/opensearch.md:
--------------------------------------------------------------------------------
1 | # OpenSearch Module
2 |
3 | [OpenSearch](https://opensearch.org/) is a community-driven, open source search and analytics suite derived from Elasticsearch. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/opensearch --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Create an index:](../../packages/modules/opensearch/src/opensearch-container.test.ts) inside_block:createIndex
15 |
16 |
17 |
18 | [Index a document:](../../packages/modules/opensearch/src/opensearch-container.test.ts) inside_block:indexDocument
19 |
20 |
21 |
22 | [Set a custom password:](../../packages/modules/opensearch/src/opensearch-container.test.ts) inside_block:customPassword
23 |
24 |
--------------------------------------------------------------------------------
/docs/modules/qdrant.md:
--------------------------------------------------------------------------------
1 | # Qdrant Module
2 |
3 | [Qdrant](https://qdrant.tech/) is an open-source, high-performance vector search engine/database. It provides a production-ready service with a convenient API to store, search, and manage points (i.e. vectors) with an additional payload.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/qdrant --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Connect to Qdrant:](../../packages/modules/qdrant/src/qdrant-container.test.ts)
15 | inside_block:connectQdrantSimple
16 |
17 |
18 |
19 | [Connect to Qdrant with an API key:](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithApiKey
20 |
21 |
22 |
23 | [Customize Qdrant instance with a config file:](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithConfig
24 |
25 |
--------------------------------------------------------------------------------
/docs/modules/rabbitmq.md:
--------------------------------------------------------------------------------
1 | # RabbitMQ Module
2 |
3 | [RabbitMQ](https://www.rabbitmq.com/) is a reliable and mature messaging and streaming broker, which is easy to deploy on cloud environments, on-premises, and on your local machine. It is currently used by millions worldwide.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/rabbitmq --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 | [Connect:](../../packages/modules/rabbitmq/src/rabbitmq-container.test.ts) inside_block:start
15 |
16 |
17 |
18 | [Set credentials:](../../packages/modules/rabbitmq/src/rabbitmq-container.test.ts) inside_block:credentials
19 |
20 |
21 |
22 | [Publish and subscribe:](../../packages/modules/rabbitmq/src/rabbitmq-container.test.ts) inside_block:pubsub
23 |
24 |
--------------------------------------------------------------------------------
/docs/modules/redpanda.md:
--------------------------------------------------------------------------------
1 | # Redpanda
2 |
3 | Testcontainers can be used to automatically instantiate and manage [Redpanda](https://redpanda.com/) containers.
4 | More precisely Testcontainers uses the official Docker images for [Redpanda](https://hub.docker.com/r/redpandadata/redpanda)
5 |
6 | !!! note
7 | This module uses features provided in `docker.redpanda.com/redpandadata/redpanda`.
8 |
9 | ## Install
10 |
11 |
12 | ```bash
13 | npm install @testcontainers/redpanda --save-dev
14 | ```
15 |
16 | ## Example
17 |
18 |
19 | [Connect:](../../packages/modules/redpanda/src/redpanda-container.test.ts) inside_block:connectToKafka
20 |
21 |
22 |
23 | [Schema registry:](../../packages/modules/redpanda/src/redpanda-container.test.ts) inside_block:connectToSchemaRegistry
24 |
25 |
26 |
27 | [Admin APIs:](../../packages/modules/redpanda/src/redpanda-container.test.ts) inside_block:connectToAdmin
28 |
29 |
30 |
31 | [Rest Proxy:](../../packages/modules/redpanda/src/redpanda-container.test.ts) inside_block:connectToRestProxy
32 |
33 |
--------------------------------------------------------------------------------
/docs/modules/scylladb.md:
--------------------------------------------------------------------------------
1 | # ScyllaDB Module
2 |
3 | [ScyllaDB](https://www.scylladb.com/) is a distributed NoSQL wide-column database for data-intensive apps that require high performance and low latency. It was designed to be compatible with Apache Cassandra while achieving significantly higher throughputs and lower latencies.
4 |
5 |
6 |
7 | ## Install
8 |
9 | ```bash
10 | npm install @testcontainers/scylladb --save-dev
11 | ```
12 |
13 | ## Examples
14 |
15 |
16 | [Connect:](../../packages/modules/scylladb/src/scylladb-container.test.ts) inside_block:connectWithDefaultCredentials
17 |
18 |
19 |
20 | [Insert & fetch data:](../../packages/modules/scylladb/src/scylladb-container.test.ts) inside_block:createAndFetchData
21 |
22 |
--------------------------------------------------------------------------------
/docs/modules/valkey.md:
--------------------------------------------------------------------------------
1 | # Valkey Module
2 |
3 | [Valkey](https://valkey.io/) is a distributed, in-memory, key-value store.
4 |
5 | ## Install
6 |
7 | ```bash
8 | npm install @testcontainers/valkey --save-dev
9 | ```
10 |
11 | ## Examples
12 |
13 |
14 |
15 | [Start container:](../../packages/modules/valkey/src/valkey-container.test.ts) inside_block:startContainer
16 |
17 |
18 |
19 |
20 |
21 | [Connect valkey client to container:](../../packages/modules/valkey/src/valkey-container.test.ts) inside_block:simpleConnect
22 |
23 |
24 |
25 |
26 |
27 | [Start container with password authentication:](../../packages/modules/valkey/src/valkey-container.test.ts) inside_block:startWithCredentials
28 |
29 |
30 |
31 |
32 |
33 | [Define volume for persistent/predefined data:](../../packages/modules/valkey/src/valkey-container.test.ts) inside_block:persistentData
34 |
35 |
36 |
37 |
38 |
39 | [Execute a command inside the container:](../../packages/modules/valkey/src/valkey-container.test.ts) inside_block:executeCommand
40 |
41 |
42 |
--------------------------------------------------------------------------------
/docs/modules/weaviate.md:
--------------------------------------------------------------------------------
1 | # Weaviate Module
2 |
3 | [Weaviate](https://weaviate.io) is an open source, AI-native vector database that helps
4 | developers create intuitive and reliable AI-powered applications.
5 |
6 | ## Install
7 |
8 | ```bash
9 | npm install @testcontainers/weaviate --save-dev
10 | ```
11 |
12 | ## Examples
13 |
14 |
15 | [Connect to Weaviate:](../../packages/modules/weaviate/src/weaviate-container.test.ts)
16 | inside_block:connectWeaviateWithClient
17 |
18 |
19 |
20 | [Connect to Weaviate with modules defined:](../../packages/modules/weaviate/src/weaviate-container.test.ts)
21 | inside_block:connectWeaviateWithModules
22 |
23 |
--------------------------------------------------------------------------------
/docs/quickstart/install.md:
--------------------------------------------------------------------------------
1 | # Install
2 |
3 | Install the Testcontainers dependency.
4 |
5 | ## NPM
6 |
7 | ```bash
8 | npm install testcontainers --save-dev
9 | ```
10 |
11 | ## Yarn
12 |
13 | ```bash
14 | yarn add testcontainers --dev
15 | ```
16 |
17 | ## PNPM
18 |
19 | ```bash
20 | pnpm add testcontainers --save-dev
21 | ```
22 |
--------------------------------------------------------------------------------
/docs/site/community-logos/github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/community-logos/slack.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/community-logos/stackoverflow.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/community-logos/twitter.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/docs/site/favicon.ico
--------------------------------------------------------------------------------
/docs/site/language-logos/dotnet.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/language-logos/haskell.svg:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/docs/site/language-logos/python.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/site/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/docs/site/logo.png
--------------------------------------------------------------------------------
/docs/site/theme/main.html:
--------------------------------------------------------------------------------
1 | {% extends "base.html" %}
2 |
3 | {% block analytics %}
4 |
5 | {% endblock %}
6 |
7 | {% block extrahead %}
8 |
9 |
10 | {% endblock %}
--------------------------------------------------------------------------------
/eslint.config.js:
--------------------------------------------------------------------------------
1 | import eslint from "@eslint/js";
2 | import json from "@eslint/json";
3 | import eslintConfigPrettier from "eslint-config-prettier/flat";
4 | import eslintPluginPrettier from "eslint-plugin-prettier/recommended";
5 | import tseslint from "typescript-eslint";
6 |
7 | /** @type {import("typescript-eslint").ConfigArray} */
8 | export default [
9 | {
10 | ignores: ["**/build/"],
11 | },
12 | {
13 | ignores: ["package-lock.json"],
14 | files: ["**/*.json"],
15 | language: "json/json",
16 | ...json.configs.recommended,
17 | },
18 | eslint.configs.recommended,
19 | ...tseslint.configs.recommended,
20 | eslintConfigPrettier,
21 | eslintPluginPrettier,
22 | {
23 | rules: {
24 | "prettier/prettier": [
25 | "error",
26 | {
27 | trailingComma: "es5",
28 | },
29 | ],
30 | "@typescript-eslint/no-empty-function": "off",
31 | "@typescript-eslint/no-unused-vars": [
32 | "error",
33 | {
34 | caughtErrors: "none",
35 | },
36 | ],
37 | "no-irregular-whitespace": "off",
38 | },
39 | },
40 | ];
41 |
--------------------------------------------------------------------------------
/packages/modules/arangodb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM arangodb:3.12.5
2 |
--------------------------------------------------------------------------------
/packages/modules/arangodb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/arangodb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "arangodb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "ArangoDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "arangojs": "^10.1.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/arangodb/src/arangodb-container.test.ts:
--------------------------------------------------------------------------------
1 | import { Database } from "arangojs";
2 | import { getImage } from "../../../testcontainers/src/utils/test-helper";
3 | import { ArangoDBContainer } from "./arangodb-container";
4 |
5 | const IMAGE = getImage(__dirname);
6 |
7 | describe("ArangoDB", { timeout: 180_000 }, () => {
8 | // connect {
9 | it("should connect and return a query result", async () => {
10 | const container = await new ArangoDBContainer(IMAGE).start();
11 | const db = new Database({ url: container.getHttpUrl() });
12 |
13 | db.database("_system");
14 | db.useBasicAuth(container.getUsername(), container.getPassword());
15 |
16 | const value = "Hello ArangoDB!";
17 | const result = await db.query({
18 | query: "RETURN @value",
19 | bindVars: { value },
20 | });
21 | const returnValue = await result.next();
22 | expect(returnValue).toBe(value);
23 |
24 | await container.stop();
25 | });
26 | // }
27 | });
28 |
--------------------------------------------------------------------------------
/packages/modules/arangodb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ArangoDBContainer, StartedArangoContainer } from "./arangodb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/arangodb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/arangodb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/azurecosmosdb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-EN20250228
2 |
--------------------------------------------------------------------------------
/packages/modules/azurecosmosdb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/azure-cosmosdb-emulator",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "azure-cosmosdb",
7 | "cosmosdb",
8 | "emulator",
9 | "testing",
10 | "docker",
11 | "testcontainers"
12 | ],
13 | "description": "Azure Cosmos DB Emulator module for Testcontainers",
14 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
18 | },
19 | "bugs": {
20 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
21 | },
22 | "main": "build/index.js",
23 | "files": [
24 | "build"
25 | ],
26 | "publishConfig": {
27 | "access": "public"
28 | },
29 | "scripts": {
30 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
31 | "build": "tsc --project tsconfig.build.json"
32 | },
33 | "devDependencies": {
34 | "@azure/cosmos": "^4.4.1"
35 | },
36 | "dependencies": {
37 | "testcontainers": "^11.2.1"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/azurecosmosdb/src/index.ts:
--------------------------------------------------------------------------------
1 | export {
2 | AzureCosmosDbEmulatorContainer,
3 | StartedAzureCosmosDbEmulatorContainer,
4 | } from "./azure-cosmosdb-emulator-container";
5 |
--------------------------------------------------------------------------------
/packages/modules/azurecosmosdb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/azurecosmosdb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/modules/azurite/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/azure-storage/azurite:3.34.0
2 |
--------------------------------------------------------------------------------
/packages/modules/azurite/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/azurite",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "azurite",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Azurite module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "@azure/data-tables": "^13.3.1",
36 | "@azure/storage-blob": "^12.27.0",
37 | "@azure/storage-queue": "^12.26.0"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/azurite/src/index.ts:
--------------------------------------------------------------------------------
1 | export { AzuriteContainer, StartedAzuriteContainer } from "./azurite-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/azurite/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/azurite/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/cassandra/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM cassandra:5.0.4
2 |
--------------------------------------------------------------------------------
/packages/modules/cassandra/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/cassandra",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "mariadb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Cassandra module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "cassandra-driver": "^4.8.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/cassandra/src/index.ts:
--------------------------------------------------------------------------------
1 | export { CassandraContainer, StartedCassandraContainer } from "./cassandra-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/cassandra/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/cassandra/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/chromadb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM chromadb/chroma:1.0.15
2 |
--------------------------------------------------------------------------------
/packages/modules/chromadb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/chromadb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "chromadb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "ChromaDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "chromadb": "^2.4.6",
33 | "ollama": "^0.5.16"
34 | },
35 | "dependencies": {
36 | "testcontainers": "^11.2.1"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/chromadb/src/chromadb-container.ts:
--------------------------------------------------------------------------------
1 | import { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait } from "testcontainers";
2 |
3 | const CHROMADB_PORT = 8000;
4 |
5 | export class ChromaDBContainer extends GenericContainer {
6 | constructor(image: string) {
7 | super(image);
8 | this.withExposedPorts(CHROMADB_PORT)
9 | .withWaitStrategy(Wait.forHttp("/api/v2/heartbeat", CHROMADB_PORT))
10 | .withStartupTimeout(120_000);
11 | }
12 |
13 | public override async start(): Promise {
14 | return new StartedChromaDBContainer(await super.start());
15 | }
16 | }
17 |
18 | export class StartedChromaDBContainer extends AbstractStartedContainer {
19 | private readonly host: string;
20 |
21 | constructor(startedTestContainer: StartedTestContainer) {
22 | super(startedTestContainer);
23 | this.host = this.startedTestContainer.getHost();
24 | }
25 |
26 | public getHttpUrl(): string {
27 | return `http://${this.host}:${this.startedTestContainer.getMappedPort(CHROMADB_PORT)}`;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/modules/chromadb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ChromaDBContainer, StartedChromaDBContainer } from "./chromadb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/chromadb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/chromadb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/modules/clickhouse/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM clickhouse/clickhouse-server:25.6-alpine
2 |
--------------------------------------------------------------------------------
/packages/modules/clickhouse/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/clickhouse",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "clickhouse",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "ClickHouse module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@clickhouse/client": "^1.11.2"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/clickhouse/src/index.ts:
--------------------------------------------------------------------------------
1 | export * from "./clickhouse-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/clickhouse/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/clickhouse/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/modules/cockroachdb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM cockroachdb/cockroach:v25.2.2
2 |
--------------------------------------------------------------------------------
/packages/modules/cockroachdb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/cockroachdb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "cockroachdb",
7 | "crdb",
8 | "testing",
9 | "docker",
10 | "testcontainers"
11 | ],
12 | "description": "CockroachDB module for Testcontainers",
13 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
17 | },
18 | "bugs": {
19 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
20 | },
21 | "main": "build/index.js",
22 | "files": [
23 | "build"
24 | ],
25 | "publishConfig": {
26 | "access": "public"
27 | },
28 | "scripts": {
29 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
30 | "build": "tsc --project tsconfig.build.json"
31 | },
32 | "devDependencies": {
33 | "@types/pg": "^8.15.4",
34 | "pg": "^8.16.3"
35 | },
36 | "dependencies": {
37 | "testcontainers": "^11.2.1"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/cockroachdb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { CockroachDbContainer, StartedCockroachDbContainer } from "./cockroachdb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/cockroachdb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/cockroachdb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/couchbase/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM couchbase/server:7.6.6
2 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/couchbase",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "couchbase",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Couchbase module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "couchbase": "4.5.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/src/couchbase-service.ts:
--------------------------------------------------------------------------------
1 | export class CouchbaseService {
2 | constructor(
3 | private readonly identifier: string,
4 | private readonly minimumQuotaMb: number
5 | ) {}
6 |
7 | static readonly KV = new CouchbaseService("kv", 256);
8 | static readonly QUERY = new CouchbaseService("n1ql", 0);
9 | static readonly SEARCH = new CouchbaseService("fts", 256);
10 | static readonly INDEX = new CouchbaseService("index", 256);
11 | static readonly ANALYTICS = new CouchbaseService("cbas", 1024);
12 | static readonly EVENTING = new CouchbaseService("eventing", 256);
13 |
14 | getIdentifier() {
15 | return this.identifier;
16 | }
17 |
18 | getMinimumQuotaMb() {
19 | return this.minimumQuotaMb;
20 | }
21 |
22 | hasQuota() {
23 | return this.minimumQuotaMb > 0;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/src/index.ts:
--------------------------------------------------------------------------------
1 | export { BucketDefinition } from "./bucket-definition";
2 | export { CouchbaseContainer, StartedCouchbaseContainer } from "./couchbase-container";
3 | export { CouchbaseService } from "./couchbase-service";
4 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/src/ports.ts:
--------------------------------------------------------------------------------
1 | const MGMT_PORT = 8091;
2 | const MGMT_SSL_PORT = 18091;
3 | const VIEW_PORT = 8092;
4 | const VIEW_SSL_PORT = 18092;
5 | const QUERY_PORT = 8093;
6 | const QUERY_SSL_PORT = 18093;
7 | const SEARCH_PORT = 8094;
8 | const SEARCH_SSL_PORT = 18094;
9 | const ANALYTICS_PORT = 8095;
10 | const ANALYTICS_SSL_PORT = 18095;
11 | const EVENTING_PORT = 8096;
12 | const EVENTING_SSL_PORT = 18096;
13 | const KV_PORT = 11210;
14 | const KV_SSL_PORT = 11207;
15 |
16 | export default {
17 | MGMT_PORT,
18 | MGMT_SSL_PORT,
19 | VIEW_PORT,
20 | VIEW_SSL_PORT,
21 | QUERY_PORT,
22 | QUERY_SSL_PORT,
23 | SEARCH_PORT,
24 | SEARCH_SSL_PORT,
25 | ANALYTICS_PORT,
26 | ANALYTICS_SSL_PORT,
27 | EVENTING_PORT,
28 | EVENTING_SSL_PORT,
29 | KV_PORT,
30 | KV_SSL_PORT,
31 | };
32 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/couchbase/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/modules/elasticsearch/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM elasticsearch:9.0.3
2 |
--------------------------------------------------------------------------------
/packages/modules/elasticsearch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/elasticsearch",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "elasticsearch",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Elasticsearch module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@elastic/elasticsearch": "^9.0.3"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/elasticsearch/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ElasticsearchContainer, StartedElasticsearchContainer } from "./elasticsearch-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/elasticsearch/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/elasticsearch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/etcd/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM quay.io/coreos/etcd:v3.6.2
2 |
--------------------------------------------------------------------------------
/packages/modules/etcd/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/etcd",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "etcd",
7 | "etcd3",
8 | "testing",
9 | "docker",
10 | "testcontainers"
11 | ],
12 | "description": "Etcd module for Testcontainers",
13 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
14 | "repository": {
15 | "type": "git",
16 | "url": "https://github.com/testcontainers/testcontainers-node"
17 | },
18 | "bugs": {
19 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
20 | },
21 | "main": "build/index.js",
22 | "files": [
23 | "build"
24 | ],
25 | "publishConfig": {
26 | "access": "public"
27 | },
28 | "scripts": {
29 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
30 | "build": "tsc --project tsconfig.build.json"
31 | },
32 | "devDependencies": {
33 | "etcd3": "^1.1.2"
34 | },
35 | "dependencies": {
36 | "testcontainers": "^11.2.1"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/etcd/src/index.ts:
--------------------------------------------------------------------------------
1 | export { EtcdContainer, StartedEtcdContainer } from "./etcd-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/etcd/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/etcd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/gcloud/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM gcr.io/google.com/cloudsdktool/cloud-sdk:529.0.0-emulators
2 | FROM fsouza/fake-gcs-server:1.52.2
3 | FROM ghcr.io/goccy/bigquery-emulator:0.6.6
--------------------------------------------------------------------------------
/packages/modules/gcloud/src/datastore-emulator-container.ts:
--------------------------------------------------------------------------------
1 | import { AbstractStartedContainer, StartedTestContainer } from "testcontainers";
2 | import { AbstractGcloudEmulator } from "./abstract-gcloud-emulator";
3 |
4 | const EMULATOR_PORT = 8080;
5 |
6 | export class DatastoreEmulatorContainer extends AbstractGcloudEmulator {
7 | constructor(image: string) {
8 | super(image, EMULATOR_PORT, "gcloud beta emulators firestore start");
9 | this.withFlag("database-mode", `datastore-mode`);
10 | }
11 |
12 | public override async start(): Promise {
13 | return new StartedDatastoreEmulatorContainer(await super.start());
14 | }
15 | }
16 |
17 | export class StartedDatastoreEmulatorContainer extends AbstractStartedContainer {
18 | constructor(startedTestContainer: StartedTestContainer) {
19 | super(startedTestContainer);
20 | }
21 |
22 | /**
23 | * @return a host:port
pair corresponding to the address on which the emulator is
24 | * reachable from the test host machine.
25 | */
26 | public getEmulatorEndpoint(): string {
27 | return `${this.getHost()}:${this.getMappedPort(EMULATOR_PORT)}`;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/modules/gcloud/src/firestore-emulator-container.ts:
--------------------------------------------------------------------------------
1 | import { AbstractStartedContainer, StartedTestContainer } from "testcontainers";
2 | import { AbstractGcloudEmulator } from "./abstract-gcloud-emulator";
3 |
4 | const EMULATOR_PORT = 8080;
5 |
6 | export class FirestoreEmulatorContainer extends AbstractGcloudEmulator {
7 | constructor(image: string) {
8 | super(image, EMULATOR_PORT, "gcloud beta emulators firestore start");
9 | }
10 |
11 | public override async start(): Promise {
12 | return new StartedFirestoreEmulatorContainer(await super.start());
13 | }
14 | }
15 |
16 | export class StartedFirestoreEmulatorContainer extends AbstractStartedContainer {
17 | constructor(startedTestContainer: StartedTestContainer) {
18 | super(startedTestContainer);
19 | }
20 |
21 | /**
22 | * @return a host:port
pair corresponding to the address on which the emulator is
23 | * reachable from the test host machine.
24 | */
25 | public getEmulatorEndpoint(): string {
26 | return `${this.getHost()}:${this.getMappedPort(EMULATOR_PORT)}`;
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/packages/modules/gcloud/src/index.ts:
--------------------------------------------------------------------------------
1 | export { BigQueryEmulatorContainer, StartedBigQueryEmulatorContainer } from "./bigquery-emulator-container";
2 | export { CloudStorageEmulatorContainer, StartedCloudStorageEmulatorContainer } from "./cloudstorage-emulator-container";
3 | export { DatastoreEmulatorContainer, StartedDatastoreEmulatorContainer } from "./datastore-emulator-container";
4 | export { FirestoreEmulatorContainer, StartedFirestoreEmulatorContainer } from "./firestore-emulator-container";
5 | export { PubSubEmulatorContainer, StartedPubSubEmulatorContainer } from "./pubsub-emulator-container";
6 |
--------------------------------------------------------------------------------
/packages/modules/gcloud/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/gcloud/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/modules/hivemq/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM hivemq/hivemq-ce:2025.4
2 |
--------------------------------------------------------------------------------
/packages/modules/hivemq/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/hivemq",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "hivemq",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "HiveMQ module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "mqtt": "^5.13.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/hivemq/src/hivemq-container.test.ts:
--------------------------------------------------------------------------------
1 | import mqtt from "mqtt";
2 | import { expect } from "vitest";
3 | import { getImage } from "../../../testcontainers/src/utils/test-helper";
4 | import { HiveMQContainer } from "./hivemq-container";
5 | const IMAGE = getImage(__dirname);
6 |
7 | describe("HiveMQContainer", { timeout: 240_000 }, () => {
8 | // connect {
9 | it("should connect to HiveMQ Community Edition via MQTT.js", async () => {
10 | const container = await new HiveMQContainer(IMAGE).start();
11 |
12 | const testMqttClient = mqtt.connect(container.getConnectionString());
13 |
14 | const promise = new Promise((resolve) => {
15 | testMqttClient.on("message", (topic, message) => {
16 | expect(message.toString()).toEqual("Test Message");
17 | testMqttClient.end();
18 | resolve();
19 | });
20 | });
21 |
22 | testMqttClient.on("connect", () => {
23 | testMqttClient.subscribe("test", (error) => {
24 | if (!error) {
25 | testMqttClient.publish("test", "Test Message");
26 | }
27 | });
28 | });
29 |
30 | return expect(promise).resolves.toBeUndefined();
31 | });
32 | // }
33 | });
34 |
--------------------------------------------------------------------------------
/packages/modules/hivemq/src/index.ts:
--------------------------------------------------------------------------------
1 | export { HiveMQContainer, StartedHiveMQContainer } from "./hivemq-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/hivemq/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/hivemq/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/k3s/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rancher/k3s:v1.33.2-k3s1
2 |
--------------------------------------------------------------------------------
/packages/modules/k3s/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/k3s",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "k3s",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "K3s module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "@kubernetes/client-node": "^1.3.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/k3s/src/index.ts:
--------------------------------------------------------------------------------
1 | export { K3sContainer, StartedK3sContainer } from "./k3s-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/k3s/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/k3s/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/kafka/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM confluentinc/cp-kafka:8.0.0
2 |
--------------------------------------------------------------------------------
/packages/modules/kafka/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/kafka",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "kafka",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Kafka module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "kafkajs": "^2.2.4"
33 | },
34 | "dependencies": {
35 | "compare-versions": "^6.1.1",
36 | "testcontainers": "^11.2.1"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/kafka/src/index.ts:
--------------------------------------------------------------------------------
1 | export { KafkaContainer, StartedKafkaContainer } from "./kafka-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/kafka/src/test-helper.ts:
--------------------------------------------------------------------------------
1 | import { Kafka, KafkaConfig, logLevel } from "kafkajs";
2 | import { StartedTestContainer } from "testcontainers";
3 |
4 | export async function testPubSub(kafkaContainer: StartedTestContainer, additionalConfig: Partial = {}) {
5 | const kafka = new Kafka({
6 | logLevel: logLevel.NOTHING,
7 | brokers: [`${kafkaContainer.getHost()}:${kafkaContainer.getMappedPort(9093)}`],
8 | ...additionalConfig,
9 | });
10 |
11 | const producer = kafka.producer();
12 | await producer.connect();
13 |
14 | const consumer = kafka.consumer({ groupId: "test-group" });
15 | await consumer.connect();
16 |
17 | await producer.send({
18 | topic: "test-topic",
19 | messages: [{ value: "test message" }],
20 | });
21 |
22 | await consumer.subscribe({ topic: "test-topic", fromBeginning: true });
23 |
24 | const consumedMessage = await new Promise((resolve) => {
25 | consumer.run({
26 | eachMessage: async ({ message }) => resolve(message.value?.toString()),
27 | });
28 | });
29 |
30 | expect(consumedMessage).toBe("test message");
31 |
32 | await consumer.disconnect();
33 | await producer.disconnect();
34 | }
35 |
--------------------------------------------------------------------------------
/packages/modules/kafka/test-certs/.gitignore:
--------------------------------------------------------------------------------
1 | ca-cert
2 | ca-cert.srl
3 | ca-key
4 | cert-file
5 | cert-signed
6 | kafka.client.truststore.pfx
--------------------------------------------------------------------------------
/packages/modules/kafka/test-certs/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM openjdk:8-slim
2 | RUN apt-get install openssl
3 | COPY generate-certs.sh /usr/local/bin
4 | RUN chmod +x /usr/local/bin/generate-certs.sh
5 | CMD ["/bin/sh", "-c", "generate-certs.sh"]
6 |
--------------------------------------------------------------------------------
/packages/modules/kafka/test-certs/README.md:
--------------------------------------------------------------------------------
1 | # Test certificates
2 |
3 | This directory contains example certificates that are used to verify that a SASL_SSL listener can be set up.
4 | You can use the files to configure the Kafka container and the client,
5 | or use provided Dockerfile to generate certificates to use in your test cases.
6 | To use it, run:
7 |
8 | ```bash
9 | docker build -t certs .
10 | docker run -v "$(pwd)":/var/output certs
11 | ```
12 |
13 | 1. You may need to delete the existing certs first:
14 |
15 | ```bash
16 | rm ca-* cert-* kafka.*
17 | ```
18 |
19 | 2. The resultant files may owned by root. Chown them to your user:
20 |
21 | ```bash
22 | sudo chown : *
23 | ```
--------------------------------------------------------------------------------
/packages/modules/kafka/test-certs/kafka.server.keystore.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/modules/kafka/test-certs/kafka.server.keystore.pfx
--------------------------------------------------------------------------------
/packages/modules/kafka/test-certs/kafka.server.truststore.pfx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/modules/kafka/test-certs/kafka.server.truststore.pfx
--------------------------------------------------------------------------------
/packages/modules/kafka/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts",
6 | "src/test-helper.ts"
7 | ],
8 | "references": [
9 | {
10 | "path": "../../testcontainers"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/packages/modules/kafka/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM kurrentplatform/kurrentdb:25.0
2 |
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/kurrentdb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "kurrentdb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "KurrentDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@kurrent/kurrentdb-client": "^1.0.4"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { KurrentDbContainer, StartedKurrentDbContainer } from "./kurrentdb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/src/kurrentdb-container.ts:
--------------------------------------------------------------------------------
1 | import { AbstractStartedContainer, GenericContainer, Wait } from "testcontainers";
2 |
3 | export class StartedKurrentDbContainer extends AbstractStartedContainer {
4 | getConnectionString(): string {
5 | return `kurrentdb://${this.getHost()}:${this.getFirstMappedPort()}?tls=false`;
6 | }
7 | }
8 |
9 | export class KurrentDbContainer extends GenericContainer {
10 | constructor(image: string) {
11 | super(image);
12 |
13 | this.withExposedPorts(2113)
14 | .withEnvironment({
15 | KURRENTDB_CLUSTER_SIZE: "1",
16 | KURRENTDB_RUN_PROJECTIONS: "All",
17 | KURRENTDB_START_STANDARD_PROJECTIONS: "true",
18 | KURRENTDB_INSECURE: "true",
19 | })
20 | .withStartupTimeout(120_000)
21 | .withWaitStrategy(Wait.forHealthCheck());
22 | }
23 |
24 | public override async start(): Promise {
25 | return new StartedKurrentDbContainer(await super.start());
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/kurrentdb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/localstack/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM localstack/localstack:4.6.0
2 |
--------------------------------------------------------------------------------
/packages/modules/localstack/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/localstack",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "localstack",
7 | "aws",
8 | "testing",
9 | "docker",
10 | "testcontainers"
11 | ],
12 | "description": "LocalStack module for Testcontainers",
13 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
17 | },
18 | "bugs": {
19 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
20 | },
21 | "main": "build/index.js",
22 | "files": [
23 | "build"
24 | ],
25 | "publishConfig": {
26 | "access": "public"
27 | },
28 | "scripts": {
29 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
30 | "build": "tsc --project tsconfig.build.json"
31 | },
32 | "dependencies": {
33 | "testcontainers": "^11.2.1"
34 | },
35 | "devDependencies": {
36 | "@aws-sdk/client-s3": "^3.842.0"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/localstack/src/index.ts:
--------------------------------------------------------------------------------
1 | export { LocalstackContainer, StartedLocalStackContainer } from "./localstack-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/localstack/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/localstack/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/mariadb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mariadb:11.8.2
2 |
--------------------------------------------------------------------------------
/packages/modules/mariadb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/mariadb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "mariadb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "MariaDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "mariadb": "^3.4.4"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/mariadb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MariaDbContainer, StartedMariaDbContainer } from "./mariadb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/mariadb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/mariadb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/minio/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM minio/minio:RELEASE.2024-12-13T22-19-12Z
2 |
--------------------------------------------------------------------------------
/packages/modules/minio/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/minio",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "minio",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "MinIO module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "minio": "^8.0.5"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/minio/src/dummy-file.txt:
--------------------------------------------------------------------------------
1 | Lorem ipsum dolor sit amet.
--------------------------------------------------------------------------------
/packages/modules/minio/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MinioContainer, StartedMinioContainer } from "./minio-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/minio/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts",
6 | "src/dummy-file.txt"
7 | ],
8 | "references": [
9 | {
10 | "path": "../../testcontainers"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/packages/modules/minio/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/mockserver/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mockserver/mockserver:5.15.0
2 |
--------------------------------------------------------------------------------
/packages/modules/mockserver/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/mockserver",
3 | "version": "11.2.1",
4 | "description": "Mockserver module for Testcontainers",
5 | "main": "build/index.js",
6 | "devDependencies": {
7 | "@types/superagent": "^8.1.9",
8 | "mockserver-client": "^5.15.0",
9 | "superagent": "^10.2.1"
10 | },
11 | "scripts": {
12 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
13 | "build": "tsc --project tsconfig.build.json"
14 | },
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
18 | },
19 | "files": [
20 | "build"
21 | ],
22 | "keywords": [
23 | "mockserver",
24 | "testing",
25 | "docker",
26 | "testcontainers"
27 | ],
28 | "license": "MIT",
29 | "bugs": {
30 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
31 | },
32 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
33 | "publishConfig": {
34 | "access": "public"
35 | },
36 | "dependencies": {
37 | "testcontainers": "^11.2.1"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/mockserver/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MockserverContainer, StartedMockserverContainer } from "./mockserver-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/mockserver/src/mockserver-container.ts:
--------------------------------------------------------------------------------
1 | import { AbstractStartedContainer, GenericContainer, Wait } from "testcontainers";
2 |
3 | export class StartedMockserverContainer extends AbstractStartedContainer {
4 | getMockserverPort(): number {
5 | return this.getFirstMappedPort();
6 | }
7 |
8 | getUrl(): string {
9 | return `http://${this.getHost()}:${this.getFirstMappedPort()}`;
10 | }
11 |
12 | getSecureUrl(): string {
13 | return `https://${this.getHost()}:${this.getFirstMappedPort()}`;
14 | }
15 | }
16 |
17 | const MOCKSERVER_PORT = 1080;
18 |
19 | export class MockserverContainer extends GenericContainer {
20 | constructor(image: string) {
21 | super(image);
22 |
23 | this.withWaitStrategy(Wait.forAll([Wait.forLogMessage(/started on port: 1080/)])).withStartupTimeout(120_000);
24 | }
25 |
26 | override async start(): Promise {
27 | this.withExposedPorts(MOCKSERVER_PORT);
28 |
29 | return new StartedMockserverContainer(await super.start());
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/modules/mockserver/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/mockserver/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/mongodb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mongo:8.0.11
2 |
--------------------------------------------------------------------------------
/packages/modules/mongodb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/mongodb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "mongodb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "MongoDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "mongoose": "^8.16.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/mongodb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MongoDBContainer, StartedMongoDBContainer } from "./mongodb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/mongodb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/mongodb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/mssqlserver/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mcr.microsoft.com/mssql/server:2022-CU13-ubuntu-22.04
2 |
--------------------------------------------------------------------------------
/packages/modules/mssqlserver/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/mssqlserver",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "mssqlserver",
7 | "mssql",
8 | "sqlserver",
9 | "testing",
10 | "docker",
11 | "testcontainers"
12 | ],
13 | "description": "MSSQL Server module for Testcontainers",
14 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
15 | "repository": {
16 | "type": "git",
17 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
18 | },
19 | "bugs": {
20 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
21 | },
22 | "main": "build/index.js",
23 | "files": [
24 | "build"
25 | ],
26 | "publishConfig": {
27 | "access": "public"
28 | },
29 | "scripts": {
30 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
31 | "build": "tsc --project tsconfig.build.json"
32 | },
33 | "devDependencies": {
34 | "@types/mssql": "^9.1.7",
35 | "mssql": "^11.0.1"
36 | },
37 | "dependencies": {
38 | "testcontainers": "^11.2.1"
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/packages/modules/mssqlserver/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MSSQLServerContainer, StartedMSSQLServerContainer } from "./mssqlserver-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/mssqlserver/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/mssqlserver/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": ["../../testcontainers/src"]
8 | }
9 | },
10 | "exclude": [
11 | "build"
12 | ],
13 | "references": [
14 | {
15 | "path": "../../testcontainers"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/modules/mysql/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM mysql:9.3.0
2 |
--------------------------------------------------------------------------------
/packages/modules/mysql/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/mysql",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "mysql",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "MySQL module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "mysql2": "^3.14.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/mysql/src/index.ts:
--------------------------------------------------------------------------------
1 | export { MySqlContainer, StartedMySqlContainer } from "./mysql-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/mysql/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/mysql/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/nats/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM nats:2.11.6-alpine
2 |
--------------------------------------------------------------------------------
/packages/modules/nats/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/nats",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "nats",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "NATS module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "@nats-io/jetstream": "^3.0.2",
36 | "@nats-io/transport-node": "^3.0.2"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/nats/src/index.ts:
--------------------------------------------------------------------------------
1 | export { NatsConnectionOptions, NatsContainer, NatsTlsOptions, StartedNatsContainer } from "./nats-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/nats/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/nats/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/neo4j/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM neo4j:5.26.9
2 |
--------------------------------------------------------------------------------
/packages/modules/neo4j/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/neo4j",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "neo4j",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Neo4J module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "neo4j-driver": "^5.28.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/neo4j/src/index.ts:
--------------------------------------------------------------------------------
1 | export { Neo4jContainer, Neo4jPlugin, StartedNeo4jContainer } from "./neo4j-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/neo4j/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/neo4j/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/ollama/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ollama/ollama:0.9.6
2 |
--------------------------------------------------------------------------------
/packages/modules/ollama/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/ollama",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "ollama",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Ollama module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/modules/ollama/src/index.ts:
--------------------------------------------------------------------------------
1 | export { OllamaContainer, StartedOllamaContainer } from "./ollama-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/ollama/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/ollama/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/opensearch/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM opensearchproject/opensearch:3.1.0
--------------------------------------------------------------------------------
/packages/modules/opensearch/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/opensearch",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "opensearch",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "OpenSearch module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@opensearch-project/opensearch": "^3.5.1",
33 | "@types/zxcvbn": "^4.4.5"
34 | },
35 | "dependencies": {
36 | "testcontainers": "^11.2.1",
37 | "zxcvbn": "^4.4.2"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/opensearch/src/index.ts:
--------------------------------------------------------------------------------
1 | export { OpenSearchContainer, StartedOpenSearchContainer } from "./opensearch-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/opensearch/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": ["build", "src/**/*.test.ts"],
4 | "references": [
5 | { "path": "../../testcontainers" }
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/packages/modules/opensearch/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": ["../../testcontainers/src"]
8 | }
9 | },
10 | "exclude": ["build"],
11 | "references": [
12 | { "path": "../../testcontainers" }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/packages/modules/postgresql/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM postgres:17.5-alpine
2 |
--------------------------------------------------------------------------------
/packages/modules/postgresql/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/postgresql",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "postgres",
7 | "postgresql",
8 | "testing",
9 | "docker",
10 | "testcontainers"
11 | ],
12 | "description": "PostgreSQL module for Testcontainers",
13 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
14 | "repository": {
15 | "type": "git",
16 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
17 | },
18 | "bugs": {
19 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
20 | },
21 | "main": "build/index.js",
22 | "files": [
23 | "build"
24 | ],
25 | "publishConfig": {
26 | "access": "public"
27 | },
28 | "scripts": {
29 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
30 | "build": "tsc --project tsconfig.build.json"
31 | },
32 | "devDependencies": {
33 | "@types/pg": "^8.15.4",
34 | "pg": "^8.16.3"
35 | },
36 | "dependencies": {
37 | "testcontainers": "^11.2.1"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/postgresql/src/index.ts:
--------------------------------------------------------------------------------
1 | export { PostgreSqlContainer, StartedPostgreSqlContainer } from "./postgresql-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/postgresql/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/postgresql/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/qdrant/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM qdrant/qdrant:v1.14.1
2 |
--------------------------------------------------------------------------------
/packages/modules/qdrant/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/qdrant",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "qdrant",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Qdrant module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@qdrant/js-client-rest": "^1.14.1"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/qdrant/src/index.ts:
--------------------------------------------------------------------------------
1 | export { QdrantContainer, StartedQdrantContainer } from "./qdrant-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/qdrant/src/test_config.yaml:
--------------------------------------------------------------------------------
1 | # Qdrant image configuration file for testing
2 | # Reference: https://qdrant.tech/documentation/guides/configuration/#configuration-file-example
3 | log_level: INFO
4 |
5 | service:
6 | api_key: "SOME_TEST_KEY"
--------------------------------------------------------------------------------
/packages/modules/qdrant/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts",
6 | "src/test_config.yaml"
7 | ],
8 | "references": [
9 | {
10 | "path": "../../testcontainers"
11 | }
12 | ]
13 | }
--------------------------------------------------------------------------------
/packages/modules/qdrant/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/rabbitmq/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM rabbitmq:4.1.2-management-alpine
2 |
--------------------------------------------------------------------------------
/packages/modules/rabbitmq/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/rabbitmq",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "rabbitmq",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "RabbitMQ module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "@types/amqplib": "^0.10.7",
36 | "amqplib": "^0.10.8"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/rabbitmq/src/index.ts:
--------------------------------------------------------------------------------
1 | export { RabbitMQContainer, StartedRabbitMQContainer } from "./rabbitmq-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/rabbitmq/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/rabbitmq/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/redis/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM redis:8.0
2 |
--------------------------------------------------------------------------------
/packages/modules/redis/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/redis",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "redis",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Redis module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "redis": "^5.5.6"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/redis/src/import.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 | redis-cli $([[ -n "$1" ]] && echo "-a $1") < "/tmp/import.redis"
4 | echo "Imported"
--------------------------------------------------------------------------------
/packages/modules/redis/src/index.ts:
--------------------------------------------------------------------------------
1 | export { RedisContainer, StartedRedisContainer } from "./redis-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/redis/src/initData.redis:
--------------------------------------------------------------------------------
1 | SET "user:001" '{"first_name":"John","last_name":"Doe","dob":"12-JUN-1970"}'
2 | SET "user:002" '{"first_name":"David","last_name":"Bloom","dob":"03-MAR-1981"}'
--------------------------------------------------------------------------------
/packages/modules/redis/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/redis/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/redpanda/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM docker.redpanda.com/redpandadata/redpanda:v25.1.7
2 |
--------------------------------------------------------------------------------
/packages/modules/redpanda/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/redpanda",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "redpanda",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Redpanda module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json",
30 | "postpack": "shx cp -r src/assets build/"
31 | },
32 | "dependencies": {
33 | "handlebars": "^4.7.8",
34 | "testcontainers": "^11.2.1"
35 | },
36 | "devDependencies": {
37 | "kafkajs": "^2.2.4"
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/packages/modules/redpanda/src/assets/bootstrap.yaml:
--------------------------------------------------------------------------------
1 | # Injected by testcontainers
2 | # This file contains cluster properties which will only be considered when
3 | # starting the cluster for the first time. Afterwards, you can configure cluster
4 | # properties via the Redpanda Admi n API.
5 |
6 | kafka_enable_authorization: false
7 | auto_create_topics_enabled: true
8 |
--------------------------------------------------------------------------------
/packages/modules/redpanda/src/index.ts:
--------------------------------------------------------------------------------
1 | export { RedpandaContainer, StartedRedpandaContainer } from "./redpanda-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/redpanda/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/redpanda/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/scylladb/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM scylladb/scylla:6.2.3
2 |
--------------------------------------------------------------------------------
/packages/modules/scylladb/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/scylladb",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "scylladb",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "ScyllaDB module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1"
33 | },
34 | "devDependencies": {
35 | "cassandra-driver": "^4.8.0"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/scylladb/src/index.ts:
--------------------------------------------------------------------------------
1 | export { ScyllaContainer, StartedScyllaContainer } from "./scylladb-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/scylladb/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/scylladb/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/selenium/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM selenium/standalone-chrome:138.0
2 |
--------------------------------------------------------------------------------
/packages/modules/selenium/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/selenium",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "selenium",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Selenium module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "@types/selenium-webdriver": "^4.1.28",
33 | "selenium-webdriver": "^4.34.0"
34 | },
35 | "dependencies": {
36 | "testcontainers": "^11.2.1"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/packages/modules/selenium/src/index.ts:
--------------------------------------------------------------------------------
1 | export {
2 | SeleniumContainer,
3 | SeleniumRecordingContainer,
4 | StartedSeleniumContainer,
5 | StartedSeleniumRecordingContainer,
6 | StoppedSeleniumContainer,
7 | StoppedSeleniumRecordingContainer,
8 | } from "./selenium-container";
9 |
--------------------------------------------------------------------------------
/packages/modules/selenium/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/selenium/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/toxiproxy/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ghcr.io/shopify/toxiproxy:2.12.0
2 |
--------------------------------------------------------------------------------
/packages/modules/toxiproxy/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/toxiproxy",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "toxiproxy",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Toxiproxy module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "dependencies": {
32 | "testcontainers": "^11.2.1",
33 | "toxiproxy-node-client": "^4.0.0"
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/modules/toxiproxy/src/index.ts:
--------------------------------------------------------------------------------
1 | export { CreatedProxy, StartedToxiProxyContainer, ToxiProxyContainer } from "./toxiproxy-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/toxiproxy/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
--------------------------------------------------------------------------------
/packages/modules/toxiproxy/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
--------------------------------------------------------------------------------
/packages/modules/valkey/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM valkey/valkey:8.1
2 |
--------------------------------------------------------------------------------
/packages/modules/valkey/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/valkey",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "valkey",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Valkey module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "redis": "^5.5.6"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/valkey/src/import.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 | set -e
3 | valkey-cli $([[ -n "$1" ]] && echo "-a $1") < "/tmp/import.valkey"
4 | echo "Imported"
--------------------------------------------------------------------------------
/packages/modules/valkey/src/index.ts:
--------------------------------------------------------------------------------
1 | export { StartedValkeyContainer, ValkeyContainer } from "./valkey-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/valkey/src/initData.valkey:
--------------------------------------------------------------------------------
1 | SET "user:001" '{"first_name":"John","last_name":"Doe","dob":"12-JUN-1970"}'
2 | SET "user:002" '{"first_name":"David","last_name":"Bloom","dob":"03-MAR-1981"}'
--------------------------------------------------------------------------------
/packages/modules/valkey/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts"
6 | ],
7 | "references": [
8 | {
9 | "path": "../../testcontainers"
10 | }
11 | ]
12 | }
13 |
--------------------------------------------------------------------------------
/packages/modules/valkey/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": ["../../testcontainers/src"]
8 | }
9 | },
10 | "exclude": [
11 | "build"
12 | ],
13 | "references": [
14 | {
15 | "path": "../../testcontainers"
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/packages/modules/weaviate/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM semitechnologies/weaviate:1.31.5
2 |
--------------------------------------------------------------------------------
/packages/modules/weaviate/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@testcontainers/weaviate",
3 | "version": "11.2.1",
4 | "license": "MIT",
5 | "keywords": [
6 | "weaviate",
7 | "testing",
8 | "docker",
9 | "testcontainers"
10 | ],
11 | "description": "Weaviate module for Testcontainers",
12 | "homepage": "https://github.com/testcontainers/testcontainers-node#readme",
13 | "repository": {
14 | "type": "git",
15 | "url": "git+https://github.com/testcontainers/testcontainers-node.git"
16 | },
17 | "bugs": {
18 | "url": "https://github.com/testcontainers/testcontainers-node/issues"
19 | },
20 | "main": "build/index.js",
21 | "files": [
22 | "build"
23 | ],
24 | "publishConfig": {
25 | "access": "public"
26 | },
27 | "scripts": {
28 | "prepack": "shx cp ../../../README.md . && shx cp ../../../LICENSE .",
29 | "build": "tsc --project tsconfig.build.json"
30 | },
31 | "devDependencies": {
32 | "weaviate-ts-client": "^2.2.0"
33 | },
34 | "dependencies": {
35 | "testcontainers": "^11.2.1"
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/modules/weaviate/src/index.ts:
--------------------------------------------------------------------------------
1 | export { StartedWeaviateContainer, WeaviateContainer } from "./weaviate-container";
2 |
--------------------------------------------------------------------------------
/packages/modules/weaviate/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts",
6 | "src/test_config.yaml"
7 | ],
8 | "references": [
9 | {
10 | "path": "../../testcontainers"
11 | }
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/packages/modules/weaviate/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build",
6 | "paths": {
7 | "testcontainers": [
8 | "../../testcontainers/src"
9 | ]
10 | }
11 | },
12 | "exclude": [
13 | "build"
14 | ],
15 | "references": [
16 | {
17 | "path": "../../testcontainers"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-malformed.yml:
--------------------------------------------------------------------------------
1 | version: 3
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | another-container:
9 | image: cristianrgreco/testcontainer:1.1.14
10 | ports:
11 | - 8080
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-buildkit/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN --mount=type=tmpfs,target=/buildkit-test \
8 | echo "BuildKit tmpfs mount is working" > /buildkit-test/success.txt && \
9 | cat /buildkit-test/success.txt
10 |
11 | RUN apk add --no-cache curl dumb-init libcap openssl
12 |
13 | RUN openssl req -x509 -nodes -days 36500 \
14 | -subj "/C=CA/ST=QC/O=Company Inc/CN=localhost" \
15 | -newkey rsa:2048 -keyout /etc/ssl/private/cert.key \
16 | -out /etc/ssl/certs/cert.crt \
17 | && chmod 666 /etc/ssl/private/cert.key
18 |
19 | RUN npm init -y && \
20 | npm install express@4.16.4
21 |
22 | COPY index.js .
23 |
24 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
25 | CMD ["node", "index.js"]
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-buildkit/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | container:
3 | build:
4 | context: .
5 | dockerfile: Dockerfile
6 | ports:
7 | - 8080
8 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-env-file/.env:
--------------------------------------------------------------------------------
1 | ENV_VAR=default
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-env-file/.env.override:
--------------------------------------------------------------------------------
1 | ENV_VAR=override
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-env-file/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | environment:
9 | - ENV_VAR=${ENV_VAR}
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-env.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | environment:
9 | - ENV_VAR=${ENV_VAR}
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-healthcheck-unhealthy.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | healthcheck:
9 | test: "curl -f http://localhost:8081/hello-world || exit 1"
10 | timeout: 3s
11 | interval: 1s
12 | retries: 0
13 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-healthcheck-with-start-period.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | healthcheck:
9 | test: "sleep 10"
10 | timeout: 10s
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-healthcheck.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | healthcheck:
9 | test: "curl -f http://localhost:8080/hello-world || exit 1"
10 | interval: 1s
11 | timeout: 3s
12 | retries: 10
13 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-many-services.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | service_1:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | service_2:
9 | image: cristianrgreco/testcontainer:1.1.14
10 | ports:
11 | - 8080
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-name.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | db:
5 | container_name: ${CONTAINER_NAME:-custom_container_name}
6 | image: cristianrgreco/testcontainer:1.1.14
7 | ports:
8 | - 8080
9 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-override/docker-compose-update.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | environment:
6 | IS_OVERRIDDEN: "true"
7 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-override/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | environment:
9 | IS_OVERRIDDEN: "false"
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-private-port.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-profile.yml:
--------------------------------------------------------------------------------
1 | version: "3.9"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | another_container:
9 | image: cristianrgreco/testcontainer:1.1.14
10 | profiles:
11 | - debug
12 | ports:
13 | - 8080
14 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose-with-volume.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 |
9 | volumes:
10 | test-volume:
11 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker-compose/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "3.5"
2 |
3 | services:
4 | container:
5 | image: cristianrgreco/testcontainer:1.1.14
6 | ports:
7 | - 8080
8 | another_container:
9 | image: cristianrgreco/testcontainer:1.1.14
10 | ports:
11 | - 8080
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-exit-immediately/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine:3.10
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | ENTRYPOINT ["echo", "This container will exit immediately."]
6 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-multi-stage/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM alpine:latest AS first
2 | LABEL stage=first
3 |
4 | FROM first AS second
5 | LABEL stage=second
6 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-buildargs/Dockerfile:
--------------------------------------------------------------------------------
1 | ARG VERSION=not-existent
2 |
3 | FROM node:${VERSION}
4 |
5 | MAINTAINER Cristian Greco
6 |
7 | EXPOSE 8080
8 |
9 | RUN apk add --no-cache dumb-init
10 |
11 | RUN npm init -y \
12 | && npm install express@4.16.4
13 |
14 | COPY index.js .
15 |
16 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
17 | CMD ["node", "index.js"]
18 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-buildargs/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | const app = express();
4 | const port = 8080;
5 |
6 | app.get("/hello-world", (req, res) => {
7 | res.status(200).send("hello-world");
8 | });
9 |
10 | app.get("/env", (req, res) => {
11 | res.status(200).json(process.env);
12 | });
13 |
14 | app.get("/cmd", (req, res) => {
15 | res.status(200).json(process.argv);
16 | });
17 |
18 | app.listen(port, () => console.log(`Listening on port ${port}`));
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-buildkit/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN --mount=type=tmpfs,target=/buildkit-test \
8 | echo "BuildKit tmpfs mount is working" > /buildkit-test/success.txt && \
9 | cat /buildkit-test/success.txt
10 |
11 | RUN apk add --no-cache curl dumb-init libcap openssl
12 |
13 | RUN openssl req -x509 -nodes -days 36500 \
14 | -subj "/C=CA/ST=QC/O=Company Inc/CN=localhost" \
15 | -newkey rsa:2048 -keyout /etc/ssl/private/cert.key \
16 | -out /etc/ssl/certs/cert.crt \
17 | && chmod 666 /etc/ssl/private/cert.key
18 |
19 | RUN npm init -y && \
20 | npm install express@4.16.4
21 |
22 | COPY index.js .
23 |
24 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
25 | CMD ["node", "index.js"]
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-custom-filename/Dockerfile-A:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN apk add --no-cache curl dumb-init
8 |
9 | RUN npm init -y \
10 | && npm install express@4.16.4
11 |
12 | COPY index.js .
13 |
14 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
15 | CMD ["node", "index.js"]
16 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-custom-filename/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | const app = express();
4 | const port = 8080;
5 |
6 | app.get("/hello-world", (req, res) => {
7 | res.status(200).send("hello-world");
8 | });
9 |
10 | app.get("/env", (req, res) => {
11 | res.status(200).json(process.env);
12 | });
13 |
14 | app.get("/cmd", (req, res) => {
15 | res.status(200).json(process.argv);
16 | });
17 |
18 | app.listen(port, () => console.log(`Listening on port ${port}`));
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/.dockerignore:
--------------------------------------------------------------------------------
1 | example1.txt
2 |
3 | example2
4 |
5 | */example3.txt
6 |
7 | **/example4.txt
8 |
9 | example5/*
10 |
11 | example6/example6.txt
12 |
13 | example7/*
14 | !example7/exist7.txt
15 |
16 | Dockerfile
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN apk add --no-cache curl dumb-init
8 |
9 | RUN npm init -y \
10 | && npm install express@4.16.4
11 |
12 | WORKDIR /opt/app
13 |
14 | COPY . .
15 |
16 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
17 | CMD ["node", "index.js"]
18 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example1.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example2/example2.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example2/example2.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example3/example3.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example3/example3.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example4/nested/example4.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example4/nested/example4.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example5/example5.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example5/example5.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example6/example6.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example6/example6.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example6/exist2.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example6/exist2.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example7/example7.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example7/example7.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example7/exist7.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/example7/exist7.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/exist1.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/testcontainers/testcontainers-node/8ed532e07a888eda6ef2902cbe07b61b6d0723e4/packages/testcontainers/fixtures/docker/docker-with-dockerignore/exist1.txt
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-dockerignore/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | const app = express();
4 | const port = 8080;
5 |
6 | app.get("/hello-world", (req, res) => {
7 | res.status(200).send("hello-world");
8 | });
9 |
10 | app.get("/env", (req, res) => {
11 | res.status(200).json(process.env);
12 | });
13 |
14 | app.get("/cmd", (req, res) => {
15 | res.status(200).json(process.argv);
16 | });
17 |
18 | app.listen(port, () => console.log(`Listening on port ${port}`));
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-health-check-with-start-period/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN apk add --no-cache curl dumb-init
8 |
9 | RUN npm init -y \
10 | && npm install express@4.16.4
11 |
12 | COPY index.js .
13 |
14 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
15 | CMD ["node", "index.js"]
16 |
17 | HEALTHCHECK --start-period=10s --interval=1s --timeout=1s --retries=1 \
18 | CMD curl -f http://localhost:8080/hello-world || exit 1
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-health-check-with-start-period/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | const app = express();
4 | const port = 8080;
5 |
6 | app.get("/hello-world", (req, res) => {
7 | res.status(200).send("hello-world");
8 | });
9 |
10 | app.get("/env", (req, res) => {
11 | res.status(200).json(process.env);
12 | });
13 |
14 | app.get("/cmd", (req, res) => {
15 | res.status(200).json(process.argv);
16 | });
17 |
18 | app.listen(port, () => console.log(`Listening on port ${port}`));
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-health-check/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN apk add --no-cache curl dumb-init
8 |
9 | RUN npm init -y \
10 | && npm install express@4.16.4
11 |
12 | COPY index.js .
13 |
14 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
15 | CMD ["node", "index.js"]
16 |
17 | HEALTHCHECK --interval=1s --timeout=3s --retries=3 \
18 | CMD curl -f http://localhost:8080/hello-world || exit 1
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker-with-health-check/index.js:
--------------------------------------------------------------------------------
1 | const express = require("express");
2 |
3 | const app = express();
4 | const port = 8080;
5 |
6 | app.get("/hello-world", (req, res) => {
7 | res.status(200).send("hello-world");
8 | });
9 |
10 | app.get("/env", (req, res) => {
11 | res.status(200).json(process.env);
12 | });
13 |
14 | app.get("/cmd", (req, res) => {
15 | res.status(200).json(process.argv);
16 | });
17 |
18 | app.listen(port, () => console.log(`Listening on port ${port}`));
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
3 | MAINTAINER Cristian Greco
4 |
5 | EXPOSE 8080
6 |
7 | RUN apk add --no-cache curl dumb-init libcap openssl
8 |
9 | RUN openssl req -x509 -nodes -days 36500 \
10 | -subj "/C=CA/ST=QC/O=Company Inc/CN=localhost" \
11 | -newkey rsa:2048 -keyout /etc/ssl/private/cert.key \
12 | -out /etc/ssl/certs/cert.crt \
13 | && chmod 666 /etc/ssl/private/cert.key
14 |
15 | RUN npm init -y \
16 | && npm install express@4.16.4
17 |
18 | COPY index.js .
19 |
20 | ENTRYPOINT ["/usr/bin/dumb-init", "--"]
21 | CMD ["node", "index.js"]
22 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/docker/test.txt:
--------------------------------------------------------------------------------
1 | hello world
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:10-alpine
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/buildargs.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM ${repositoryName}:${repositoryPort}/testcontainer-private:1.1.12
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/formatted.Dockerfile:
--------------------------------------------------------------------------------
1 | from node:latest
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/multistage-duplicate.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:latest
2 |
3 | FROM node:latest
4 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/multistage-naming.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:latest as first-stage
2 |
3 | FROM alpine:latest as runner
4 |
--------------------------------------------------------------------------------
/packages/testcontainers/fixtures/docker/dockerfile-parser/multistage.Dockerfile:
--------------------------------------------------------------------------------
1 | FROM node:latest
2 |
3 | FROM alpine:latest
4 |
--------------------------------------------------------------------------------
/packages/testcontainers/smoke-test.js:
--------------------------------------------------------------------------------
1 | const { GenericContainer } = require("./build/index");
2 |
3 | (async () => {
4 | const container = await new GenericContainer("alpine:3.12")
5 | .withCommand(["sleep", "infinity"])
6 | .start();
7 |
8 | await container.stop();
9 | })();
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/smoke-test.mjs:
--------------------------------------------------------------------------------
1 | import { GenericContainer } from "./build/index.js";
2 |
3 | const container = await new GenericContainer("alpine:3.12")
4 | .withCommand(["sleep", "infinity"])
5 | .start();
6 |
7 | await container.stop();
8 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/clock.ts:
--------------------------------------------------------------------------------
1 | export type Time = number;
2 |
3 | export interface Clock {
4 | getTime(): Time;
5 | }
6 |
7 | export class SystemClock implements Clock {
8 | public getTime(): Time {
9 | return Date.now();
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/file-lock.ts:
--------------------------------------------------------------------------------
1 | import { writeFile } from "fs/promises";
2 | import path from "path";
3 | import lockFile from "proper-lockfile";
4 | import { log } from "./logger";
5 |
6 | export async function withFileLock(fileName: string, fn: () => T): Promise {
7 | const file = await createEmptyTmpFile(fileName);
8 |
9 | let releaseLockFn;
10 | try {
11 | log.debug(`Acquiring lock file "${file}"...`);
12 | releaseLockFn = await lockFile.lock(file, {
13 | retries: { forever: true, factor: 1, minTimeout: 500, maxTimeout: 3000, randomize: true },
14 | });
15 | log.debug(`Acquired lock file "${file}"`);
16 | return await fn();
17 | } finally {
18 | if (releaseLockFn) {
19 | log.debug(`Releasing lock file "${file}"...`);
20 | await releaseLockFn();
21 | log.debug(`Released lock file "${file}"`);
22 | }
23 | }
24 | }
25 |
26 | async function createEmptyTmpFile(fileName: string): Promise {
27 | const tmp = await import("tmp");
28 | const file = path.resolve(tmp.tmpdir, fileName);
29 | await writeFile(file, "");
30 | return file;
31 | }
32 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/hash.test.ts:
--------------------------------------------------------------------------------
1 | import { hash } from "./hash";
2 |
3 | test("should return a consistent hash", () => {
4 | const str = "Hello, world!";
5 |
6 | expect(hash(str)).toBe("315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3");
7 | expect(hash(str)).toBe("315f5bdb76d078c43b8ac0064e4a0164612b1fce77c869345bfc94c75894edd3");
8 | });
9 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/hash.ts:
--------------------------------------------------------------------------------
1 | import crypto from "crypto";
2 |
3 | export function hash(str: string): string {
4 | return crypto.createHash("sha256").update(str).digest("hex");
5 | }
6 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/index.ts:
--------------------------------------------------------------------------------
1 | export { withFileLock } from "./file-lock";
2 | export { hash } from "./hash";
3 | export { Logger, buildLog, composeLog, containerLog, execLog, log, pullLog } from "./logger";
4 | export { IntervalRetry, Retry } from "./retry";
5 | export { streamToString } from "./streams";
6 | export * from "./time";
7 | export * from "./type-guards";
8 | export { RandomUuid, Uuid, randomUuid } from "./uuid";
9 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/streams.ts:
--------------------------------------------------------------------------------
1 | import { Readable } from "stream";
2 |
3 | type Options = { trim: boolean };
4 |
5 | export const streamToString = async (stream: Readable, options: Options = { trim: false }): Promise => {
6 | const chunks = [];
7 |
8 | for await (const chunk of stream) {
9 | chunks.push(Buffer.from(chunk));
10 | }
11 |
12 | const str = Buffer.concat(chunks).toString("utf-8");
13 |
14 | return options.trim ? str.trim() : str;
15 | };
16 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/time.test.ts:
--------------------------------------------------------------------------------
1 | import { toNanos, toSeconds } from "./time";
2 |
3 | test.for([
4 | [0, 0],
5 | [10, 0],
6 | [999, 0],
7 | [1010, 1],
8 | [1999, 1],
9 | [10_000, 10],
10 | [-10, -0],
11 | [-999, -0],
12 | [-1010, -1],
13 | [-1999, -1],
14 | [-10_000, -10],
15 | ])("should convert %i ms to %i seconds", ([ms, s]) => {
16 | expect(toSeconds(ms)).toEqual(s);
17 | });
18 |
19 | test.for([
20 | [0, 0],
21 | [1, 1_000_000],
22 | [-1, -1_000_000],
23 | ])("should convert %i ms to %i ns", ([ms, ns]) => {
24 | expect(toNanos(ms)).toEqual(ns);
25 | });
26 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/time.ts:
--------------------------------------------------------------------------------
1 | export const toSeconds = (ms: number) => Math.trunc(ms * 1e-3);
2 |
3 | export const toNanos = (ms: number) => ms * 1e6;
4 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/type-guards.ts:
--------------------------------------------------------------------------------
1 | export const isDefined = (value: T | undefined): value is T => value !== undefined;
2 |
3 | export const isEmptyString = (value: string): value is string => value.trim() === "";
4 |
5 | export const isNotEmptyString = (value: string): value is string => !isEmptyString(value);
6 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/common/uuid.ts:
--------------------------------------------------------------------------------
1 | import crypto from "crypto";
2 | import { hash } from "./hash";
3 |
4 | export interface Uuid {
5 | nextUuid(): string;
6 | }
7 |
8 | export class RandomUuid implements Uuid {
9 | public nextUuid(): string {
10 | return hash(crypto.randomUUID()).substring(0, 12);
11 | }
12 | }
13 |
14 | const randomUuidGen = new RandomUuid();
15 | export const randomUuid = () => randomUuidGen.nextUuid();
16 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/cred-helpers.test.ts:
--------------------------------------------------------------------------------
1 | import { CredHelpers } from "./cred-helpers";
2 | import { AuthConfig, ContainerRuntimeConfig } from "./types";
3 |
4 | describe("CredHelpers", () => {
5 | const locator = new CredHelpers();
6 |
7 | describe("getAuthConfig", () => {
8 | it("should return undefined when config does not contain cred helpers", async () => {
9 | const containerRuntimeConfig: ContainerRuntimeConfig = {};
10 | expect(await locator.getAuthConfig("registry-name", containerRuntimeConfig)).toBe(undefined);
11 | });
12 |
13 | it.skip("should work", async () => {
14 | const containerRuntimeConfig: ContainerRuntimeConfig = { credHelpers: { "index.docker.io": "desktop" } };
15 | const authConfig: AuthConfig = {
16 | username: expect.stringMatching(/.+/),
17 | password: expect.stringMatching(/.+/),
18 | registryAddress: "index.docker.io",
19 | };
20 | expect(await locator.getAuthConfig("index.docker.io", containerRuntimeConfig)).toEqual(authConfig);
21 | });
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/cred-helpers.ts:
--------------------------------------------------------------------------------
1 | import { CredentialProvider } from "./credential-provider";
2 | import { ContainerRuntimeConfig } from "./types";
3 |
4 | export class CredHelpers extends CredentialProvider {
5 | public getName(): string {
6 | return "CredHelpers";
7 | }
8 |
9 | public getCredentialProviderName(registry: string, dockerConfig: ContainerRuntimeConfig): string | undefined {
10 | if (dockerConfig.credHelpers?.[registry] !== undefined) {
11 | return dockerConfig.credHelpers[registry];
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/creds-store.ts:
--------------------------------------------------------------------------------
1 | import { CredentialProvider } from "./credential-provider";
2 | import { ContainerRuntimeConfig } from "./types";
3 |
4 | export class CredsStore extends CredentialProvider {
5 | public getName(): string {
6 | return "CredsStore";
7 | }
8 |
9 | public getCredentialProviderName(registry: string, dockerConfig: ContainerRuntimeConfig): string | undefined {
10 | if (dockerConfig.credsStore !== undefined && dockerConfig.credsStore.length > 0) {
11 | return dockerConfig.credsStore;
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/registry-auth-locator.ts:
--------------------------------------------------------------------------------
1 | import { AuthConfig, ContainerRuntimeConfig } from "./types";
2 |
3 | export interface RegistryAuthLocator {
4 | getName(): string;
5 | getAuthConfig(registry: string, dockerConfig: ContainerRuntimeConfig): Promise;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/registry-matches.test.ts:
--------------------------------------------------------------------------------
1 | import { registryMatches } from "./registry-matches";
2 |
3 | describe("registryMatches", () => {
4 | it("should return true when registries are equal", () => {
5 | expect(registryMatches("https://registry.example.com", "https://registry.example.com")).toBe(true);
6 | });
7 |
8 | it("should return true when registries are equal without protocol", () => {
9 | expect(registryMatches("https://registry.example.com", "registry.example.com")).toBe(true);
10 | });
11 |
12 | it("should return false when registries do not match", () => {
13 | expect(registryMatches("https://registry.example.com", "registry.example.co")).toBe(false);
14 | });
15 | });
16 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/registry-matches.ts:
--------------------------------------------------------------------------------
1 | export const registryMatches = (authConfigRegistry: string, requestedRegistry: string): boolean =>
2 | authConfigRegistry == requestedRegistry || authConfigRegistry.endsWith("://" + requestedRegistry);
3 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/auth/types.ts:
--------------------------------------------------------------------------------
1 | export type CredentialProviderGetResponse = {
2 | ServerURL: string;
3 | Username: string;
4 | Secret: string;
5 | };
6 |
7 | export type CredentialProviderListResponse = {
8 | [registry: string]: string;
9 | };
10 |
11 | export type Auth = {
12 | auth?: string;
13 | email?: string;
14 | username?: string;
15 | password?: string;
16 | };
17 |
18 | export type AuthConfig = {
19 | username: string;
20 | password: string;
21 | registryAddress: string;
22 | email?: string;
23 | };
24 |
25 | export type RegistryConfig = {
26 | [registryAddress: string]: {
27 | username: string;
28 | password: string;
29 | };
30 | };
31 |
32 | export type ContainerRuntimeConfig = {
33 | credHelpers?: { [registry: string]: string };
34 | credsStore?: string;
35 | auths?: { [registry: string]: Auth };
36 | };
37 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/compose/default-compose-options.ts:
--------------------------------------------------------------------------------
1 | import { IDockerComposeOptions } from "docker-compose";
2 | import { EOL } from "os";
3 | import { composeLog, isNotEmptyString } from "../../../common";
4 | import { ComposeOptions } from "./types";
5 |
6 | export function defaultComposeOptions(
7 | environment: NodeJS.ProcessEnv,
8 | options: ComposeOptions
9 | ): Partial {
10 | const log = options.logger ?? composeLog;
11 |
12 | return {
13 | log: false,
14 | callback: log.enabled()
15 | ? (chunk) => {
16 | chunk
17 | .toString()
18 | .split(EOL)
19 | .filter(isNotEmptyString)
20 | .forEach((line) => log.trace(line.trim()));
21 | }
22 | : undefined,
23 | cwd: options.filePath,
24 | config: options.files,
25 | composeOptions: options.composeOptions,
26 | commandOptions: options.commandOptions,
27 | env: {
28 | ...process.env,
29 | COMPOSE_PROJECT_NAME: options.projectName,
30 | ...{ ...environment, ...options.environment },
31 | },
32 | executable: options.executable,
33 | };
34 | }
35 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.test.ts:
--------------------------------------------------------------------------------
1 | import { parseComposeContainerName } from "./parse-compose-container-name";
2 |
3 | describe("parseComposeContainerName", () => {
4 | it("should remove project name label", () => {
5 | const name = "/project-name_container_1";
6 | const expected = "container_1";
7 |
8 | expect(parseComposeContainerName("project-name", name)).toBe(expected);
9 | });
10 |
11 | it("should resolve explicit container name", () => {
12 | const name = "/custom-container";
13 | const expected = "custom-container";
14 |
15 | expect(parseComposeContainerName("project-name", name)).toBe(expected);
16 | });
17 |
18 | it("should throw error if unable to resolve container name", () => {
19 | expect(() => parseComposeContainerName("project-name", "container_1")).toThrowError(
20 | `Unable to resolve container name for container name: "container_1", project name: "project-name"`
21 | );
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/compose/parse-compose-container-name.ts:
--------------------------------------------------------------------------------
1 | export function parseComposeContainerName(projectName: string, containerName: string): string {
2 | if (containerName.includes(projectName)) {
3 | return containerName.substring(`/${projectName}_`.length);
4 | } else if (containerName.startsWith("/")) {
5 | return containerName.substring(1);
6 | } else {
7 | throw new Error(
8 | `Unable to resolve container name for container name: "${containerName}", project name: "${projectName}"`
9 | );
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/compose/types.ts:
--------------------------------------------------------------------------------
1 | import { Logger } from "../../../common";
2 |
3 | export type ComposeOptions = {
4 | filePath: string;
5 | files: string | string[];
6 | projectName: string;
7 | commandOptions?: string[];
8 | composeOptions?: string[];
9 | environment?: NodeJS.ProcessEnv;
10 | logger?: Logger;
11 | executable?: ComposeExecutableOptions;
12 | };
13 |
14 | export type ComposeExecutableOptions =
15 | | {
16 | executablePath: string;
17 | options?: string[] | (string | string[])[];
18 | standalone?: never;
19 | }
20 | | {
21 | executablePath?: string;
22 | options?: never;
23 | standalone: true;
24 | };
25 |
26 | export type ComposeDownOptions = {
27 | timeout: number;
28 | removeVolumes: boolean;
29 | };
30 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/container/types.ts:
--------------------------------------------------------------------------------
1 | export type Environment = { [key in string]: string };
2 |
3 | export type ExecOptions = { workingDir: string; user: string; env: Environment; log: boolean };
4 |
5 | export type ExecResult = { output: string; stdout: string; stderr: string; exitCode: number };
6 |
7 | export type ContainerCommitOptions = {
8 | repo: string;
9 | tag: string;
10 | comment?: string;
11 | author?: string;
12 | pause?: boolean;
13 | changes?: string;
14 | };
15 |
16 | export const CONTAINER_STATUSES = ["created", "restarting", "running", "removing", "paused", "exited", "dead"] as const;
17 |
18 | export type ContainerStatus = (typeof CONTAINER_STATUSES)[number];
19 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/image/image-client.ts:
--------------------------------------------------------------------------------
1 | import { ImageBuildOptions, ImageInspectInfo } from "dockerode";
2 | import { ImageName } from "../../image-name";
3 |
4 | export interface ImageClient {
5 | build(context: string, opts: ImageBuildOptions): Promise;
6 | pull(imageName: ImageName, opts?: { force: boolean; platform: string | undefined }): Promise;
7 | inspect(imageName: ImageName): Promise;
8 | exists(imageName: ImageName): Promise;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/network/network-client.ts:
--------------------------------------------------------------------------------
1 | import { Network, NetworkCreateOptions } from "dockerode";
2 |
3 | export interface NetworkClient {
4 | getById(id: string): Network;
5 |
6 | create(opts: NetworkCreateOptions): Promise;
7 |
8 | remove(network: Network): Promise;
9 | }
10 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/clients/types.ts:
--------------------------------------------------------------------------------
1 | export type Info = {
2 | node: NodeInfo;
3 | containerRuntime: ContainerRuntimeInfo;
4 | };
5 |
6 | export type NodeInfo = {
7 | version: string;
8 | architecture: string;
9 | platform: string;
10 | };
11 |
12 | export type ContainerRuntimeInfo = {
13 | host: string;
14 | hostIps: HostIp[];
15 | remoteSocketPath: string;
16 | indexServerAddress: string;
17 | serverVersion: number;
18 | operatingSystem: string;
19 | operatingSystemType: string;
20 | architecture: string;
21 | cpus: number;
22 | memory: number;
23 | runtimes: string[];
24 | labels: string[];
25 | };
26 |
27 | export type HostIp = { address: string; family: number };
28 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/index.ts:
--------------------------------------------------------------------------------
1 | export { getAuthConfig } from "./auth/get-auth-config";
2 | export { ContainerRuntimeClient, getContainerRuntimeClient } from "./clients/client";
3 | export { parseComposeContainerName } from "./clients/compose/parse-compose-container-name";
4 | export { ComposeDownOptions, ComposeExecutableOptions, ComposeOptions } from "./clients/compose/types";
5 | export { HostIp } from "./clients/types";
6 | export { ImageName } from "./image-name";
7 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.test.ts:
--------------------------------------------------------------------------------
1 | import { NpipeSocketStrategy } from "./npipe-socket-strategy";
2 |
3 | describe("NpipeSocketStrategy", () => {
4 | it("should return undefined when platform is not win32", async () => {
5 | const result = await new NpipeSocketStrategy("linux").getResult();
6 | expect(result).toBeUndefined();
7 | });
8 |
9 | it("should return expected result", async () => {
10 | const result = await new NpipeSocketStrategy("win32").getResult();
11 |
12 | expect(result?.uri).toEqual("npipe:////./pipe/docker_engine");
13 | expect(result?.dockerOptions).toEqual({ socketPath: "//./pipe/docker_engine" });
14 | expect(result?.composeEnvironment).toEqual({});
15 | expect(result?.allowUserOverrides).toEqual(true);
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/npipe-socket-strategy.ts:
--------------------------------------------------------------------------------
1 | import { ContainerRuntimeClientStrategy } from "./strategy";
2 | import { ContainerRuntimeClientStrategyResult } from "./types";
3 |
4 | export class NpipeSocketStrategy implements ContainerRuntimeClientStrategy {
5 | constructor(private readonly platform: NodeJS.Platform = process.platform) {}
6 |
7 | getName(): string {
8 | return "NpipeSocketStrategy";
9 | }
10 |
11 | async getResult(): Promise {
12 | if (this.platform !== "win32") {
13 | return;
14 | }
15 |
16 | return {
17 | uri: "npipe:////./pipe/docker_engine",
18 | dockerOptions: { socketPath: "//./pipe/docker_engine" },
19 | composeEnvironment: {},
20 | allowUserOverrides: true,
21 | };
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/strategy.ts:
--------------------------------------------------------------------------------
1 | import { ContainerRuntimeClientStrategyResult } from "./types";
2 |
3 | export interface ContainerRuntimeClientStrategy {
4 | getName(): string;
5 | getResult(): Promise;
6 | }
7 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/testcontainers-host-strategy.ts:
--------------------------------------------------------------------------------
1 | import { DockerOptions } from "dockerode";
2 | import { URL } from "url";
3 | import { ContainerRuntimeClientStrategy } from "./strategy";
4 | import { ContainerRuntimeClientStrategyResult } from "./types";
5 | import { getContainerRuntimeConfig } from "./utils/config";
6 |
7 | export class TestcontainersHostStrategy implements ContainerRuntimeClientStrategy {
8 | getName(): string {
9 | return "TestcontainersHostStrategy";
10 | }
11 |
12 | async getResult(): Promise {
13 | const { tcHost } = await getContainerRuntimeConfig();
14 |
15 | if (!tcHost) {
16 | return;
17 | }
18 |
19 | const dockerOptions: DockerOptions = {};
20 |
21 | const { hostname, port } = new URL(tcHost);
22 | dockerOptions.host = hostname;
23 | dockerOptions.port = port;
24 |
25 | return {
26 | uri: tcHost,
27 | dockerOptions,
28 | composeEnvironment: {
29 | DOCKER_HOST: tcHost,
30 | },
31 | allowUserOverrides: false,
32 | };
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/types.ts:
--------------------------------------------------------------------------------
1 | import { DockerOptions } from "dockerode";
2 |
3 | export type ContainerRuntimeClientStrategyResult = {
4 | uri: string;
5 | dockerOptions: DockerOptions;
6 | composeEnvironment: NodeJS.ProcessEnv;
7 | allowUserOverrides: boolean;
8 | };
9 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/strategies/unix-socket-strategy.ts:
--------------------------------------------------------------------------------
1 | import { existsSync } from "fs";
2 | import { ContainerRuntimeClientStrategy } from "./strategy";
3 | import { ContainerRuntimeClientStrategyResult } from "./types";
4 |
5 | export class UnixSocketStrategy implements ContainerRuntimeClientStrategy {
6 | constructor(private readonly platform: NodeJS.Platform = process.platform) {}
7 |
8 | getName(): string {
9 | return "UnixSocketStrategy";
10 | }
11 |
12 | async getResult(): Promise {
13 | if ((this.platform !== "linux" && this.platform !== "darwin") || !existsSync("/var/run/docker.sock")) {
14 | return;
15 | }
16 |
17 | return {
18 | uri: "unix:///var/run/docker.sock",
19 | dockerOptions: { socketPath: "/var/run/docker.sock" },
20 | composeEnvironment: {},
21 | allowUserOverrides: true,
22 | };
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/attach-container.ts:
--------------------------------------------------------------------------------
1 | import Dockerode from "dockerode";
2 | import { Readable } from "stream";
3 | import { log } from "../../common";
4 | import { demuxStream } from "./demux-stream";
5 |
6 | export const attachContainer = async (dockerode: Dockerode, container: Dockerode.Container): Promise => {
7 | try {
8 | const stream = (await container.attach({ stream: true, stdout: true, stderr: true })) as NodeJS.ReadableStream;
9 | return demuxStream(dockerode, stream as Readable);
10 | } catch (err) {
11 | log.error(`Failed to attach to container: ${err}`, { containerId: container.id });
12 | throw err;
13 | }
14 | };
15 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/demux-stream.ts:
--------------------------------------------------------------------------------
1 | import Dockerode from "dockerode";
2 | import { PassThrough, Readable } from "stream";
3 | import { log } from "../../common";
4 |
5 | export async function demuxStream(dockerode: Dockerode, stream: Readable): Promise {
6 | try {
7 | const demuxedStream = new PassThrough({ autoDestroy: true, encoding: "utf-8" });
8 | dockerode.modem.demuxStream(stream, demuxedStream, demuxedStream);
9 | stream.on("end", () => demuxedStream.end());
10 | demuxedStream.on("close", () => {
11 | if (!stream.destroyed) {
12 | stream.destroy();
13 | }
14 | });
15 | return demuxedStream;
16 | } catch (err) {
17 | log.error(`Failed to demux stream: ${err}`);
18 | throw err;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/image-exists.ts:
--------------------------------------------------------------------------------
1 | import AsyncLock from "async-lock";
2 | import Dockerode from "dockerode";
3 | import { ImageName } from "../image-name";
4 |
5 | const existingImages = new Set();
6 | const imageCheckLock = new AsyncLock();
7 |
8 | export async function imageExists(dockerode: Dockerode, imageName: ImageName): Promise {
9 | return imageCheckLock.acquire(imageName.string, async () => {
10 | if (existingImages.has(imageName.string)) {
11 | return true;
12 | }
13 |
14 | try {
15 | await dockerode.getImage(imageName.string).inspect();
16 | existingImages.add(imageName.string);
17 | return true;
18 | } catch (err) {
19 | if (err instanceof Error && err.message.toLowerCase().includes("no such image")) {
20 | return false;
21 | }
22 | throw err;
23 | }
24 | });
25 | }
26 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.test.ts:
--------------------------------------------------------------------------------
1 | import { HostIp } from "../clients/types";
2 | import { lookupHostIps } from "./lookup-host-ips";
3 |
4 | const mockDnsLookup = vi.fn();
5 | vi.mock("dns/promises", () => {
6 | return {
7 | lookup: () => mockDnsLookup(),
8 | };
9 | });
10 |
11 | describe.sequential("lookupHostIps", () => {
12 | it("should return a list of resolved host IPs when host is not an IP", async () => {
13 | const hostIps: HostIp[] = [{ address: "127.0.0.1", family: 4 }];
14 | mockDnsLookup.mockResolvedValueOnce(hostIps);
15 | expect(await lookupHostIps("localhost")).toEqual(hostIps);
16 | });
17 |
18 | it("should return host IP and v4 family when host is an IPv4 IP", async () => {
19 | expect(await lookupHostIps("127.0.0.1")).toEqual([{ address: "127.0.0.1", family: 4 }]);
20 | expect(mockDnsLookup).not.toHaveBeenCalled();
21 | });
22 |
23 | it("should return host IP and v6 family when host is an IPv6 IP", async () => {
24 | expect(await lookupHostIps("::1")).toEqual([{ address: "::1", family: 6 }]);
25 | expect(mockDnsLookup).not.toHaveBeenCalled();
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/lookup-host-ips.ts:
--------------------------------------------------------------------------------
1 | import { lookup as dnsLookup } from "dns/promises";
2 | import net from "net";
3 | import { HostIp } from "../clients/types";
4 |
5 | export const lookupHostIps = async (host: string): Promise => {
6 | if (net.isIP(host) === 0) {
7 | return await dnsLookup(host, { all: true });
8 | } else {
9 | return [{ address: host, family: net.isIP(host) }];
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/remote-container-runtime-socket-path.ts:
--------------------------------------------------------------------------------
1 | import { ContainerRuntimeClientStrategyResult } from "../strategies/types";
2 |
3 | export const getRemoteContainerRuntimeSocketPath = (
4 | containerRuntimeStrategyResult: ContainerRuntimeClientStrategyResult,
5 | containerRuntimeOs: string,
6 | platform: NodeJS.Platform = process.platform,
7 | env: NodeJS.ProcessEnv = process.env
8 | ): string => {
9 | if (containerRuntimeStrategyResult.allowUserOverrides) {
10 | if (env["TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE"] !== undefined) {
11 | return env["TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE"];
12 | }
13 | }
14 |
15 | let socketPath: string;
16 | if (containerRuntimeOs === "Docker Desktop") {
17 | socketPath = "/var/run/docker.sock";
18 | } else if (containerRuntimeStrategyResult.uri.startsWith("unix://")) {
19 | socketPath = containerRuntimeStrategyResult.uri.replace("unix://", "");
20 | } else {
21 | socketPath = "/var/run/docker.sock";
22 | }
23 |
24 | return platform === "win32" ? `/${socketPath}` : socketPath;
25 | };
26 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/container-runtime/utils/start-container.ts:
--------------------------------------------------------------------------------
1 | import Dockerode from "dockerode";
2 | import { log } from "../../common";
3 |
4 | export const startContainer = async (container: Dockerode.Container): Promise => {
5 | try {
6 | await container.start();
7 | } catch (err) {
8 | log.error(`Failed to start container: ${err}`, { containerId: container.id });
9 | throw err;
10 | }
11 | };
12 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/docker-compose-environment/downed-docker-compose-environment.ts:
--------------------------------------------------------------------------------
1 | export class DownedDockerComposeEnvironment {}
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/docker-compose-environment/stopped-docker-compose-environment.ts:
--------------------------------------------------------------------------------
1 | import { ComposeDownOptions, ComposeOptions, getContainerRuntimeClient } from "../container-runtime";
2 | import { DownedDockerComposeEnvironment } from "./downed-docker-compose-environment";
3 |
4 | export class StoppedDockerComposeEnvironment {
5 | constructor(private readonly options: ComposeOptions) {}
6 |
7 | public async down(options: Partial = {}): Promise {
8 | const client = await getContainerRuntimeClient();
9 | const resolvedOptions: ComposeDownOptions = { timeout: 0, removeVolumes: true, ...options };
10 | await client.compose.down(this.options, resolvedOptions);
11 | return new DownedDockerComposeEnvironment();
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/generic-container/abstract-stopped-container.ts:
--------------------------------------------------------------------------------
1 | import { StoppedTestContainer } from "../test-container";
2 |
3 | export class AbstractStoppedContainer implements StoppedTestContainer {
4 | constructor(protected readonly stoppedTestContainer: StoppedTestContainer) {}
5 |
6 | getId(): string {
7 | return this.stoppedTestContainer.getId();
8 | }
9 |
10 | copyArchiveFromContainer(path: string): Promise {
11 | return this.stoppedTestContainer.copyArchiveFromContainer(path);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/generic-container/stopped-generic-container.ts:
--------------------------------------------------------------------------------
1 | import Dockerode from "dockerode";
2 | import { log } from "../common";
3 | import { getContainerRuntimeClient } from "../container-runtime";
4 | import { StoppedTestContainer } from "../test-container";
5 |
6 | export class StoppedGenericContainer implements StoppedTestContainer {
7 | constructor(private readonly container: Dockerode.Container) {}
8 |
9 | getId(): string {
10 | return this.container.id;
11 | }
12 |
13 | async copyArchiveFromContainer(path: string): Promise {
14 | log.debug(`Copying archive "${path}" from container...`, { containerId: this.container.id });
15 | const client = await getContainerRuntimeClient();
16 | const stream = await client.container.fetchArchive(this.container, path);
17 | log.debug(`Copied archive "${path}" from container`, { containerId: this.container.id });
18 | return stream;
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/dockerfile-parser.ts:
--------------------------------------------------------------------------------
1 | import { promises as fs } from "fs";
2 | import { isNotEmptyString, log } from "../common";
3 | import { ImageName } from "../container-runtime";
4 | import { BuildArgs } from "../types";
5 |
6 | const buildArgRegex = /\${([^{]+)}/g;
7 |
8 | export async function getDockerfileImages(dockerfile: string, buildArgs: BuildArgs): Promise {
9 | try {
10 | return (await parseImages(dockerfile))
11 | .map((line) => line.replace(buildArgRegex, (_, arg) => buildArgs[arg] ?? ""))
12 | .map((line) => ImageName.fromString(line.trim()));
13 | } catch (err) {
14 | log.error(`Failed to read Dockerfile "${dockerfile}": ${err}`);
15 | throw err;
16 | }
17 | }
18 |
19 | async function parseImages(dockerfile: string): Promise {
20 | return Array.from(
21 | (await fs.readFile(dockerfile, "utf8"))
22 | .split(/\r?\n/)
23 | .filter((line) => line.toUpperCase().startsWith("FROM"))
24 | .map((line) => line.split(" ").filter(isNotEmptyString)[1])
25 | .reduce((prev, next) => prev.add(next), new Set())
26 | .values()
27 | );
28 | }
29 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/labels.ts:
--------------------------------------------------------------------------------
1 | import { LIB_VERSION } from "../version";
2 |
3 | export const LABEL_TESTCONTAINERS = "org.testcontainers";
4 | export const LABEL_TESTCONTAINERS_LANG = "org.testcontainers.lang";
5 | export const LABEL_TESTCONTAINERS_VERSION = "org.testcontainers.version";
6 | export const LABEL_TESTCONTAINERS_SESSION_ID = "org.testcontainers.session-id";
7 | export const LABEL_TESTCONTAINERS_SSHD = "org.testcontainers.sshd";
8 | export const LABEL_TESTCONTAINERS_CONTAINER_HASH = "org.testcontainers.container-hash";
9 | export const LABEL_TESTCONTAINERS_RYUK = "org.testcontainers.ryuk";
10 |
11 | export function createLabels(): Record {
12 | return {
13 | [LABEL_TESTCONTAINERS]: "true",
14 | [LABEL_TESTCONTAINERS_LANG]: "node",
15 | [LABEL_TESTCONTAINERS_VERSION]: LIB_VERSION,
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/port-generator.test.ts:
--------------------------------------------------------------------------------
1 | import { FixedPortGenerator, RandomPortGenerator } from "./port-generator";
2 |
3 | describe("PortGenerator", () => {
4 | describe("FixedPortGenerator", () => {
5 | it("should return pre-determined ports", async () => {
6 | const fixedPortGenerator = new FixedPortGenerator([1000, 1001]);
7 |
8 | await expect(fixedPortGenerator.generatePort()).resolves.toBe(1000);
9 | await expect(fixedPortGenerator.generatePort()).resolves.toBe(1001);
10 | });
11 | });
12 |
13 | describe("RandomPortGenerator", () => {
14 | it("should generate a random available port", async () => {
15 | const randomPortGenerator = new RandomPortGenerator();
16 |
17 | const port1 = await randomPortGenerator.generatePort();
18 | const port2 = await randomPortGenerator.generatePort();
19 |
20 | expect(port1).toBeDefined();
21 | expect(port2).toBeDefined();
22 | expect(port1).not.toBe(port2);
23 | });
24 | });
25 | });
26 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/port-generator.ts:
--------------------------------------------------------------------------------
1 | export interface PortGenerator {
2 | generatePort(): Promise;
3 | }
4 |
5 | export class RandomPortGenerator {
6 | public async generatePort(): Promise {
7 | const { default: getPort } = await import("get-port");
8 | return getPort();
9 | }
10 | }
11 |
12 | export class FixedPortGenerator implements PortGenerator {
13 | private portIndex = 0;
14 |
15 | constructor(private readonly ports: number[]) {}
16 |
17 | public generatePort(): Promise {
18 | return Promise.resolve(this.ports[this.portIndex++]);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/port.ts:
--------------------------------------------------------------------------------
1 | export type PortWithBinding = {
2 | container: number;
3 | host: number;
4 | };
5 |
6 | export type PortWithOptionalBinding = number | PortWithBinding;
7 |
8 | export const getContainerPort = (port: PortWithOptionalBinding): number =>
9 | typeof port === "number" ? port : port.container;
10 |
11 | export const hasHostBinding = (port: PortWithOptionalBinding): port is PortWithBinding => {
12 | return typeof port === "object" && port.host !== undefined;
13 | };
14 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/pull-policy.test.ts:
--------------------------------------------------------------------------------
1 | import { ImagePullPolicy, PullPolicy } from "./pull-policy";
2 |
3 | test("default pull policy should return false", () => {
4 | expect(PullPolicy.defaultPolicy().shouldPull()).toBe(false);
5 | });
6 |
7 | test("always pull policy should return true", () => {
8 | expect(PullPolicy.alwaysPull().shouldPull()).toBe(true);
9 | });
10 |
11 | test("should be able to create a custom pull policy", () => {
12 | class CustomPullPolicy implements ImagePullPolicy {
13 | public shouldPull(): boolean {
14 | return true;
15 | }
16 | }
17 |
18 | expect(new CustomPullPolicy().shouldPull()).toBe(true);
19 | });
20 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/utils/pull-policy.ts:
--------------------------------------------------------------------------------
1 | export interface ImagePullPolicy {
2 | shouldPull(): boolean;
3 | }
4 |
5 | class DefaultPullPolicy implements ImagePullPolicy {
6 | public shouldPull(): boolean {
7 | return false;
8 | }
9 | }
10 |
11 | class AlwaysPullPolicy implements ImagePullPolicy {
12 | public shouldPull(): boolean {
13 | return true;
14 | }
15 | }
16 |
17 | export class PullPolicy {
18 | public static defaultPolicy(): ImagePullPolicy {
19 | return new DefaultPullPolicy();
20 | }
21 |
22 | public static alwaysPull(): ImagePullPolicy {
23 | return new AlwaysPullPolicy();
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/version.ts:
--------------------------------------------------------------------------------
1 | export const LIB_VERSION = "11.2.1";
2 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/wait-strategies/host-port-wait-strategy.test.ts:
--------------------------------------------------------------------------------
1 | import { RandomUuid } from "../common";
2 | import { GenericContainer } from "../generic-container/generic-container";
3 | import { checkContainerIsHealthy, getRunningContainerNames } from "../utils/test-helper";
4 |
5 | describe("HostPortWaitStrategy", { timeout: 180_000 }, () => {
6 | it("should wait for port", async () => {
7 | const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14").withExposedPorts(8080).start();
8 |
9 | await checkContainerIsHealthy(container);
10 |
11 | await container.stop();
12 | });
13 |
14 | it("should stop the container when the host port check wait strategy times out", async () => {
15 | const containerName = `container-${new RandomUuid().nextUuid()}`;
16 |
17 | await expect(
18 | new GenericContainer("cristianrgreco/testcontainer:1.1.14")
19 | .withName(containerName)
20 | .withExposedPorts(8081)
21 | .withStartupTimeout(0)
22 | .start()
23 | ).rejects.toThrowError(/Port \d+ not bound after 0ms/);
24 |
25 | expect(await getRunningContainerNames()).not.toContain(containerName);
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/wait-strategies/one-shot-startup-startegy.test.ts:
--------------------------------------------------------------------------------
1 | import { GenericContainer } from "../generic-container/generic-container";
2 | import { Wait } from "./wait";
3 |
4 | describe("OneShotStartupCheckStrategy", { timeout: 180_000 }, () => {
5 | it("should wait for container to finish", async () => {
6 | const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14")
7 | .withCommand(["/bin/sh", "-c", 'sleep 2; echo "Ready"'])
8 | .withWaitStrategy(Wait.forOneShotStartup())
9 | .start();
10 |
11 | await container.stop();
12 | });
13 |
14 | it("should fail if container did not finish succesfully", async () => {
15 | await expect(() =>
16 | new GenericContainer("cristianrgreco/testcontainer:1.1.14")
17 | .withCommand(["/bin/sh", "-c", "not-existing"])
18 | .withWaitStrategy(Wait.forOneShotStartup())
19 | .start()
20 | ).rejects.toThrow("Container failed to start for");
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/wait-strategies/shell-wait-strategy.test.ts:
--------------------------------------------------------------------------------
1 | import { GenericContainer } from "../generic-container/generic-container";
2 | import { Wait } from "./wait";
3 |
4 | describe("ShellWaitStrategy", { timeout: 180_000 }, () => {
5 | it("should wait for successful command", async () => {
6 | const container = await new GenericContainer("cristianrgreco/testcontainer:1.1.14")
7 | .withCommand(["/bin/sh", "-c", "sleep 0.5; touch /tmp/test.lock; node index.js"])
8 | .withWaitStrategy(Wait.forSuccessfulCommand("stat /tmp/test.lock"))
9 | .start();
10 |
11 | await container.stop();
12 | });
13 |
14 | it("should timeout when command not successful", async () => {
15 | await expect(() =>
16 | new GenericContainer("cristianrgreco/testcontainer:1.1.14")
17 | .withWaitStrategy(Wait.forSuccessfulCommand("stat /tmp/test.lock"))
18 | .withStartupTimeout(1000)
19 | .start()
20 | ).rejects.toThrowError(`Shell command "stat /tmp/test.lock" not successful`);
21 | });
22 | });
23 |
--------------------------------------------------------------------------------
/packages/testcontainers/src/wait-strategies/wait-strategy.ts:
--------------------------------------------------------------------------------
1 | import Dockerode from "dockerode";
2 | import { BoundPorts } from "../utils/bound-ports";
3 |
4 | export interface WaitStrategy {
5 | waitUntilReady(container: Dockerode.Container, boundPorts: BoundPorts, startTime?: Date): Promise;
6 |
7 | withStartupTimeout(startupTimeoutMs: number): WaitStrategy;
8 |
9 | isStartupTimeoutSet(): boolean;
10 |
11 | getStartupTimeout(): number;
12 | }
13 |
14 | export abstract class AbstractWaitStrategy implements WaitStrategy {
15 | protected startupTimeoutMs = 60_000;
16 | private startupTimeoutSet = false;
17 |
18 | public abstract waitUntilReady(
19 | container: Dockerode.Container,
20 | boundPorts: BoundPorts,
21 | startTime?: Date
22 | ): Promise;
23 |
24 | public withStartupTimeout(startupTimeoutMs: number): this {
25 | this.startupTimeoutMs = startupTimeoutMs;
26 | this.startupTimeoutSet = true;
27 | return this;
28 | }
29 |
30 | public isStartupTimeoutSet(): boolean {
31 | return this.startupTimeoutSet;
32 | }
33 |
34 | public getStartupTimeout(): number {
35 | return this.startupTimeoutMs;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/packages/testcontainers/tsconfig.build.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "exclude": [
4 | "build",
5 | "src/**/*.test.ts",
6 | "src/utils/test-helper.ts",
7 | ]
8 | }
--------------------------------------------------------------------------------
/packages/testcontainers/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.base.json",
3 | "compilerOptions": {
4 | "rootDir": "src",
5 | "outDir": "build"
6 | },
7 | "exclude": [
8 | "build"
9 | ]
10 | }
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | mkdocs==1.6.1
2 | mkdocs-codeinclude-plugin==0.2.1
3 | mkdocs-markdownextradata-plugin==0.2.6
4 | mkdocs-material==9.6.15
--------------------------------------------------------------------------------
/runtime.txt:
--------------------------------------------------------------------------------
1 | 3.8
2 |
--------------------------------------------------------------------------------
/sonar-project.properties:
--------------------------------------------------------------------------------
1 | sonar.projectKey=testcontainers_testcontainers-node
2 | sonar.organization=testcontainers
3 | sonar.projectName=testcontainers-node
4 | sonar.projectVersion=v11.2.1
5 | sonar.sources=packages
6 | sonar.tests=packages
7 | sonar.test.inclusions=packages/**/*.test.ts
8 | sonar.javascript.lcov.reportPaths=coverage/lcov.info
--------------------------------------------------------------------------------
/tsconfig.base.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "incremental": true,
4 | "lib": ["ES2023"],
5 | "target": "ES2023",
6 | "types": [
7 | "vitest/globals"
8 | ],
9 | "module": "commonjs",
10 | "declaration": true,
11 | "sourceMap": true,
12 | "strict": true,
13 | "moduleResolution": "node",
14 | "esModuleInterop": true,
15 | "skipLibCheck": true,
16 | "forceConsistentCasingInFileNames": true,
17 | "noImplicitOverride": true,
18 | "composite": true
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/vitest.config.ts:
--------------------------------------------------------------------------------
1 | import * as path from "path";
2 | import { defineConfig } from "vitest/config";
3 |
4 | export default defineConfig({
5 | test: {
6 | globals: true,
7 | env: {
8 | DEBUG: "testcontainers*",
9 | },
10 | silent: "passed-only",
11 | mockReset: true,
12 | restoreMocks: true,
13 | unstubEnvs: true,
14 | retry: process.env.CI ? 3 : 0,
15 | sequence: {
16 | concurrent: true,
17 | },
18 | alias: {
19 | testcontainers: path.resolve(__dirname, "packages/testcontainers/src"),
20 | },
21 | },
22 | });
23 |
--------------------------------------------------------------------------------