update all
This commit is contained in:
4
Redis/standalone/.gitignore
vendored
Normal file
4
Redis/standalone/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
data
|
||||
data-replica
|
||||
.conf
|
||||
|
18
Redis/standalone/conf/redis-commander.json
Normal file
18
Redis/standalone/conf/redis-commander.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"connections": [
|
||||
{
|
||||
"label": "standalone",
|
||||
"host": "redis",
|
||||
"port": 6379,
|
||||
"password": "password",
|
||||
"dbIndex": 0
|
||||
},
|
||||
{
|
||||
"label": "replica",
|
||||
"host": "redis-replica",
|
||||
"port": 6379,
|
||||
"password": "password",
|
||||
"dbIndex": 0
|
||||
}
|
||||
]
|
||||
}
|
30
Redis/standalone/conf/redis-replica.conf
Normal file
30
Redis/standalone/conf/redis-replica.conf
Normal file
@ -0,0 +1,30 @@
|
||||
# All option are available at https://redis.io/docs/management/config-file/
|
||||
|
||||
# Bind to all interfaces
|
||||
bind 0.0.0.0
|
||||
|
||||
# Specify the port for Redis to listen on
|
||||
port 6379
|
||||
|
||||
# Enable slave mode
|
||||
replicaof redis 6379
|
||||
|
||||
# Enable persistence
|
||||
appendonly yes
|
||||
|
||||
# Set the path to the appendonly file
|
||||
appendfilename "appendonly.aof"
|
||||
|
||||
# Set the path to the directory containing the appendonly file
|
||||
dir /data-replica
|
||||
|
||||
# Set the path to the dump file
|
||||
dbfilename "dump.rdb"
|
||||
|
||||
# Set the path to the directory containing the dump file
|
||||
dir /data-replica
|
||||
|
||||
# Optional: Set a password for authentication
|
||||
masterauth password
|
||||
requirepass password
|
||||
|
29
Redis/standalone/conf/redis.conf
Normal file
29
Redis/standalone/conf/redis.conf
Normal file
@ -0,0 +1,29 @@
|
||||
# All option are available at https://redis.io/docs/management/config-file/
|
||||
# Bind to all interfaces
|
||||
bind 0.0.0.0
|
||||
|
||||
# Specify the port for Redis to listen on
|
||||
port 6379
|
||||
|
||||
# Enable master mode
|
||||
# replica-serve-stale-data no
|
||||
# replica-read-only yes
|
||||
replication-mode master
|
||||
|
||||
# Enable persistence
|
||||
appendonly yes
|
||||
|
||||
# Set the path to the appendonly file
|
||||
appendfilename "appendonly.aof"
|
||||
|
||||
# Set the path to the directory containing the appendonly file
|
||||
dir /data
|
||||
|
||||
# Set the path to the dump file
|
||||
dbfilename "dump.rdb"
|
||||
|
||||
# Set the path to the directory containing the dump file
|
||||
dir /data
|
||||
|
||||
# Optional: Set a password for authentication
|
||||
requirepass password
|
49
Redis/standalone/docker-compose.yml
Normal file
49
Redis/standalone/docker-compose.yml
Normal file
@ -0,0 +1,49 @@
|
||||
version: '3.9'
|
||||
|
||||
services:
|
||||
redis:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: redis.Dockerfile
|
||||
container_name: redis
|
||||
ports:
|
||||
- '6379:6379'
|
||||
volumes:
|
||||
- ./data:/data
|
||||
- .conf/redis.conf:/usr/local/etc/redis/redis.conf
|
||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||
healthcheck:
|
||||
test: redis-cli ping
|
||||
start_period: 15s
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
redis-replica:
|
||||
build:
|
||||
context: ./docker
|
||||
dockerfile: redis.Dockerfile
|
||||
container_name: redis-replica
|
||||
ports:
|
||||
- '6380:6379'
|
||||
volumes:
|
||||
- ./data-replica:/data
|
||||
- .conf/redis-replica.conf:/usr/local/etc/redis/redis.conf
|
||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf", "--slaveof", "redis", "6379"]
|
||||
healthcheck:
|
||||
test: redis-cli ping
|
||||
start_period: 15s
|
||||
interval: 5s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
|
||||
redis-commander:
|
||||
container_name: redis-commander
|
||||
hostname: redis-commander
|
||||
image: ghcr.io/joeferner/redis-commander:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- ./conf/redis-commander.json:/redis-commander/config/local-production.json
|
||||
ports:
|
||||
- "8081:8081"
|
1
Redis/standalone/docker/redis.Dockerfile
Normal file
1
Redis/standalone/docker/redis.Dockerfile
Normal file
@ -0,0 +1 @@
|
||||
FROM redis:latest
|
Reference in New Issue
Block a user