Community Module

These modules are maintained by the community, outside of the Testcontainers project.

Description

PostGIS extends the capabilities of the PostgreSQL relational database by adding support for storing, indexing, and querying geospatial data.

Examples

Dependency:
<dependency>
    <groupId>org.testcontainers</groupId>
    <artifactId>postgresql</artifactId>
    <version>1.20.0</version>
    <scope>test</scope>
</dependency>
Usage:
var image = DockerImageName.parse("postgis/postgis:12-3.0")
    .asCompatibleSubstituteFor("postgres");
var postgis = new PostgreSQLContainer<>(image);
postgis.start();
Dependency:
go get github.com/testcontainers/testcontainers-go/modules/postgres
Usage:
postgisContainer, err := postgres.Run(context.Background(),
  "postgis/postgis:12-3.0",
  postgres.WithDatabase("test"),
  postgres.WithUsername("user"),
  postgres.WithPassword("password"),
)
Dependency:
dotnet add package Testcontainers.PostgreSql
Usage:
var postgisContainer = new PostgreSqlBuilder()
  .WithImage("postgis/postgis:12-3.0")
  .Build();
await postgisContainer.StartAsync();
Dependency:
npm install @testcontainers/postgresql --save-dev
Usage:
const container = await new PostgreSqlContainer("postgis/postgis:12-3.0").start();
Dependency:
cargo add -F postgres --dev testcontainers-modules
Usage:
use testcontainers::core::ImageExt;
testcontainers_modules::postgres::Postgres::default().with_name("postgis/postgis").with_tag("16-3.5-alpine").start()