feat: Redis compose

This commit is contained in:
2025-10-29 20:26:18 +01:00
parent 69c5101532
commit 13dae5ae3b
3 changed files with 63 additions and 0 deletions

34
redis/compose.yml Normal file
View File

@@ -0,0 +1,34 @@
services:
redis-master:
image: redis:8.2
restart: never
command: ["redis-server", "--loglevel", "verbose"]
ports:
- "6379:6379"
volumes:
- redis_data:/data
redis-replica:
image: redis:8.2
restart: never
depends_on:
- redis-master
command: ["redis-server", "--replicaof", "redis-master", "6379", "--loglevel", "verbose"]
ports:
- "6380:6379"
volumes:
- redis_data_replica:/data
readis:
image: hollodotme/readis:2.2
restart: never
depends_on:
- redis-master
ports:
- "8080:80"
volumes:
- ./readis:/code/config:Z
volumes:
redis_data:
redis_data_replica:

6
redis/readis/app.php Normal file
View File

@@ -0,0 +1,6 @@
<?php
declare(strict_types=1);
return [
'baseUrl' => 'http://localhost:8080/',
];

23
redis/readis/servers.php Normal file
View File

@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
return [
[
'name' => 'Redis Master',
'host' => 'redis-master',
'port' => 6379,
'auth' => null,
'timeout' => 2.5,
'retryInterval' => 100,
'databaseMap' => [],
],
[
'name' => 'Redis Replicata',
'host' => 'redis-replica',
'port' => 6379,
'auth' => null,
'timeout' => 2.5,
'retryInterval' => 100,
'databaseMap' => [],
],
];