Skip to content

Commit

Permalink
docs(redis): Document port and unixSocket options
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh committed Oct 12, 2024
1 parent 821dbf3 commit 18ac153
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions doc/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

[Redis](https://redis.io/) is an in-memory data structure store used as a database, cache, and message broker.

## Unix socket

Redis supports the usage of [Unix socket](https://man7.org/linux/man-pages/man2/socket.2.html) to listen to connections. By default, Redis listens to connections over TCP on port `6379`. When using Unix socket, you can decide to either enable listening on both or disable listening on TCP by setting port to `0` (recommended).

```nix
# Inside `process-compose.<name>`
{
services.redis."r1" = {
enable = true;
port = 0;
# relative paths are relative to the data directory, which is `$PWD/data/r1` by default
unixSocket = "./redis.sock";
};
}
```
## Usage example

<https://github.com/juspay/services-flake/blob/main/nix/services/redis_test.nix>

0 comments on commit 18ac153

Please sign in to comment.