diff --git a/compose.yml b/compose.yml index 9d9fba7..fb432f3 100644 --- a/compose.yml +++ b/compose.yml @@ -21,8 +21,10 @@ services: container_name: iptv-keydb image: eqalpha/keydb:latest user: ${KEYDB_UID}:${KEYDB_GID} + entrypoint: ["sh", "/entrypoint.sh"] volumes: - ./docker/keydb/keydb.conf:/etc/keydb/keydb.conf + - ./docker/keydb/entrypoint.sh:/entrypoint.sh - ./docker/keydb/data/:/data:rw - ./log/keydb:/var/log/keydb/:rw ports: diff --git a/docker/keydb/entrypoint.sh b/docker/keydb/entrypoint.sh new file mode 100644 index 0000000..b844a92 --- /dev/null +++ b/docker/keydb/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +trap 'echo "Received SIGTERM, saving KeyDB data..."; keydb-cli SAVE; echo "Data saved. Exiting."; exit 0' TERM +echo "[entrypoint] Starting KeyDB..." +exec keydb-server /etc/keydb/keydb.conf "$@" diff --git a/docker/keydb/keydb.conf b/docker/keydb/keydb.conf index 74f9254..39be5f5 100644 --- a/docker/keydb/keydb.conf +++ b/docker/keydb/keydb.conf @@ -493,7 +493,7 @@ dir /data # network partition replicas automatically try to reconnect to masters # and resynchronize with them. # -# replicaof +replicaof no one # If the master is password protected (using the "requirepass" configuration # directive below) it is possible to tell the replica to authenticate before @@ -526,7 +526,7 @@ dir /data # UNSUBSCRIBE, PSUBSCRIBE, PUNSUBSCRIBE, PUBLISH, PUBSUB, COMMAND, POST, # HOST and LATENCY. # -replica-serve-stale-data yes +replica-serve-stale-data no # Active Replicas will allow read only data access while loading remote RDBs # provided they are permitted to serve stale data. As an option you may also @@ -585,7 +585,7 @@ replica-read-only yes # # With slow disks and fast (large bandwidth) networks, diskless replication # works better. -repl-diskless-sync no +#repl-diskless-sync no # When diskless replication is enabled, it is possible to configure the delay # the server waits in order to spawn the child that transfers the RDB via socket @@ -597,7 +597,7 @@ repl-diskless-sync no # # The delay is specified in seconds, and by default is 5 seconds. To disable # it entirely just set it to 0 seconds and the transfer will start ASAP. -repl-diskless-sync-delay 5 +#repl-diskless-sync-delay 5 # ----------------------------------------------------------------------------- # WARNING: RDB diskless load is experimental. Since in this setup the replica @@ -1279,7 +1279,7 @@ disable-thp yes # # Please check http://redis.io/topics/persistence for more information. -appendonly no +appendonly yes # The name of the append only file (default: "appendonly.aof")