Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into geo-search-with-pol…
Browse files Browse the repository at this point in the history
…ygons
  • Loading branch information
gerzse committed Jun 11, 2024
2 parents 9923e81 + 3a0c724 commit fe3fcc1
Show file tree
Hide file tree
Showing 24 changed files with 1,471 additions and 140 deletions.
39 changes: 23 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,23 @@ version: "3.8"
services:

redis:
image: redis/redis-stack-server:edge
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-standalone
command: redis-server --enable-debug-command yes
ports:
- 6379:6379
environment:
- "REDIS_ARGS=--enable-debug-command yes --enable-module-command yes"
profiles:
- standalone
- sentinel
- replica
- all

replica:
image: redis/redis-stack-server:edge
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-replica
depends_on:
- redis
environment:
- "REDIS_ARGS=--replicaof redis 6379"
command: redis-server --replicaof redis 6379
ports:
- 6380:6379
profiles:
Expand All @@ -35,6 +33,8 @@ services:
build:
context: .
dockerfile: dockers/Dockerfile.cluster
args:
REDIS_IMAGE: ${REDIS_IMAGE:-redis:latest}
ports:
- 16379:16379
- 16380:16380
Expand Down Expand Up @@ -63,13 +63,11 @@ services:
- "./dockers/stunnel/keys:/etc/stunnel/keys:ro"

sentinel:
image: redis/redis-stack-server:edge
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-sentinel
depends_on:
- redis
environment:
- "REDIS_ARGS=--port 26379"
entrypoint: "/opt/redis-stack/bin/redis-sentinel /redis.conf --port 26379"
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26379"
ports:
- 26379:26379
volumes:
Expand All @@ -79,13 +77,11 @@ services:
- all

sentinel2:
image: redis/redis-stack-server:edge
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-sentinel2
depends_on:
- redis
environment:
- "REDIS_ARGS=--port 26380"
entrypoint: "/opt/redis-stack/bin/redis-sentinel /redis.conf --port 26380"
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26380"
ports:
- 26380:26380
volumes:
Expand All @@ -95,15 +91,26 @@ services:
- all

sentinel3:
image: redis/redis-stack-server:edge
image: ${REDIS_IMAGE:-redis:latest}
container_name: redis-sentinel3
depends_on:
- redis
entrypoint: "/opt/redis-stack/bin/redis-sentinel /redis.conf --port 26381"
entrypoint: "/usr/local/bin/redis-sentinel /redis.conf --port 26381"
ports:
- 26381:26381
volumes:
- "./dockers/sentinel.conf:/redis.conf"
profiles:
- sentinel
- all

redis-stack:
image: redis/redis-stack-server:edge
container_name: redis-stack
ports:
- 6479:6379
environment:
- "REDIS_ARGS=--enable-debug-command yes --enable-module-command yes"
profiles:
- standalone
- all
4 changes: 2 additions & 2 deletions dockers/Dockerfile.cluster
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM redis/redis-stack-server:edge as rss
ARG REDIS_IMAGE=redis:latest
FROM $REDIS_IMAGE

COPY dockers/create_cluster.sh /create_cluster.sh
RUN ls -R /opt/redis-stack
RUN chmod a+x /create_cluster.sh

ENTRYPOINT [ "/create_cluster.sh"]
6 changes: 0 additions & 6 deletions dockers/cluster.redis.conf
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
protected-mode no
enable-debug-command yes
loadmodule /opt/redis-stack/lib/redisearch.so
loadmodule /opt/redis-stack/lib/redisgraph.so
loadmodule /opt/redis-stack/lib/redistimeseries.so
loadmodule /opt/redis-stack/lib/rejson.so
loadmodule /opt/redis-stack/lib/redisbloom.so
loadmodule /opt/redis-stack/lib/redisgears.so v8-plugin-path /opt/redis-stack/lib/libredisgears_v8_plugin.so
6 changes: 3 additions & 3 deletions dockers/create_cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dir /nodes/$PORT
EOF

set -x
/opt/redis-stack/bin/redis-server /nodes/$PORT/redis.conf
/usr/local/bin/redis-server /nodes/$PORT/redis.conf
sleep 1
if [ $? -ne 0 ]; then
echo "Redis failed to start, exiting."
Expand All @@ -40,8 +40,8 @@ EOF
echo 127.0.0.1:$PORT >> /nodes/nodemap
done
if [ -z "${REDIS_PASSWORD}" ]; then
echo yes | /opt/redis-stack/bin/redis-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
echo yes | /usr/local/bin/redis-cli --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
else
echo yes | opt/redis-stack/bin/redis-cli -a ${REDIS_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
echo yes | /usr/local/bin/redis-cli -a ${REDIS_PASSWORD} --cluster create `seq -f 127.0.0.1:%g ${START_PORT} ${END_PORT}` --cluster-replicas 1
fi
tail -f /redis.log
Loading

0 comments on commit fe3fcc1

Please sign in to comment.