# `Testcontainers.RedisContainer`
[🔗](https://github.com/testcontainers/testcontainers-elixir/blob/main/lib/container/redis_container.ex#L4)

Provides functionality for creating and managing Redis container configurations.

# `t`

```elixir
@type t() :: %Testcontainers.RedisContainer{
  check_image: term(),
  image: term(),
  password: term(),
  port: term(),
  reuse: term(),
  wait_timeout: term()
}
```

# `connection_url`

Generates the connection URL for accessing the Redis service running within the container.

This URL is based on the standard localhost IP and the mapped port for the container.

## Parameters

- `container`: The active Redis container instance in the form of a %Container{} struct.

## Examples

    iex> RedisContainer.connection_url(container)
    "http://localhost:32768" # This value will be different depending on the mapped port.

# `default_image`

Retrieves the default Docker image for the Redis container.

# `new`

Creates a new `RedisContainer` struct with default configurations.

# `port`

Returns the port on the _host machine_ where the Redis container is listening.

# `with_check_image`

Set the regular expression to check the image validity.

# `with_image`

Overrides the default image used for the Redis container.

## Examples

    iex> config = RedisContainer.new()
    iex> new_config = RedisContainer.with_image(config, "redis:xyz")
    iex> new_config.image
    "redis:xyz"

# `with_password`

Sets the password for the Redis container.

## Examples

    iex> config = RedisContainer.new()
    iex> new_config = RedisContainer.with_password(config, "secret")
    iex> new_config.password
    "secret"

# `with_port`

Overrides the default port used for the Redis container.

Note: this will not change what port the docker container is listening to internally.

## Examples

    iex> config = RedisContainer.new()
    iex> new_config = RedisContainer.with_port(config, 1111)
    iex> new_config.port
    1111

# `with_reuse`

Set the reuse flag to reuse the container if it is already running.

# `with_wait_timeout`

Overrides the default wait timeout used for the Redis container.

Note: this timeout will be used for each individual wait strategy.

## Examples

    iex> config = RedisContainer.new()
    iex> new_config = RedisContainer.with_wait_timeout(config, 8000)
    iex> new_config.wait_timeout
    8000

---

*Consult [api-reference.md](api-reference.md) for complete listing*
