11# Redis Enterprise Test Environment
2- # Usage: docker compose up -d
2+ #
3+ # Usage:
4+ # docker compose up -d # Start enterprise and initialize cluster
5+ # docker compose logs init # Check initialization status
6+ # docker compose down -v # Clean up everything
37
48services :
5- # Redis Enterprise single node for testing
9+ # Redis Enterprise server
610 enterprise :
711 image : ${REDIS_ENTERPRISE_IMAGE:-redislabs/redis:latest}
812 container_name : redis-enterprise
@@ -11,7 +15,7 @@ services:
1115 ports :
1216 - " 9443:9443" # REST API
1317 - " 8443:8443" # Web UI
14- - " 12000-12010 :12000-12010 " # Database ports
18+ - " 12000:12000" # Database port
1519 environment :
1620 ACCEPT_EULA : " yes"
1721 volumes :
@@ -22,8 +26,10 @@ services:
2226 timeout : 5s
2327 retries : 30
2428 start_period : 60s
29+ networks :
30+ - redis-net
2531
26- # Initialize Enterprise cluster using our CLI
32+ # Initialize cluster and create database
2733 init :
2834 build :
2935 context : .
@@ -35,47 +41,54 @@ services:
3541 condition : service_healthy
3642 environment :
3743 REDIS_ENTERPRISE_URL : " https://enterprise:9443"
38- REDIS_ENTERPRISE_USER :
" [email protected] " 39- REDIS_ENTERPRISE_PASSWORD : " Redis123!"
4044 RUST_LOG : ${RUST_LOG:-info}
45+ networks :
46+ - redis-net
4147 command : |
4248 sh -c '
43- echo "Waiting for cluster to be ready..." &&
44- sleep 10 &&
45- echo "Initializing cluster..." &&
46- ./target/release/redisctl bootstrap create \
49+ echo "========================================" &&
50+ echo "Initializing Redis Enterprise cluster..." &&
51+ echo "========================================" &&
52+
53+ # Initialize cluster
54+ redisctl enterprise workflow init-cluster \
4755 --insecure \
4856 --name "test-cluster" \
49575058 --password "Redis123!" \
5159 --accept-eula &&
60+
61+ echo "" &&
62+ echo "========================================" &&
5263 echo "Creating test database..." &&
53- ./target/release/redisctl database create \
64+ echo "========================================" &&
65+
66+ # Create database using the workflow
67+ redisctl enterprise workflow create-database \
5468 --insecure \
5569 --name "test-db" \
5670 --memory 100MB \
5771 --port 12000 &&
58- echo "Cluster initialization complete!"
72+
73+ echo "" &&
74+ echo "========================================" &&
75+ echo "Setup complete!" &&
76+ echo "" &&
77+ echo "Web UI: https://localhost:8443" &&
78+ echo "Username: [email protected] " && 79+ echo "Password: Redis123!" &&
80+ echo "" &&
81+ echo "API: https://localhost:9443" &&
82+ echo "Database: redis://localhost:12000" &&
83+ echo "========================================" &&
84+
85+ # List databases to confirm
86+ redisctl enterprise database list --insecure --output table
5987 '
6088
61- # CLI container for interactive testing
62- cli :
63- build :
64- context : .
65- dockerfile : Dockerfile
66- container_name : redis-cli
67- stdin_open : true
68- tty : true
69- environment :
70- REDIS_ENTERPRISE_URL : " https://enterprise:9443"
71- REDIS_ENTERPRISE_USER :
" [email protected] " 72- REDIS_ENTERPRISE_PASSWORD : " Redis123!"
73- RUST_LOG : ${RUST_LOG:-info}
74- volumes :
75- - ./:/workspace:ro
76- working_dir : /workspace
77- command : ["/bin/sh"]
78- profiles : ["cli"]
89+ networks :
90+ redis-net :
91+ driver : bridge
7992
8093volumes :
8194 enterprise-data:
0 commit comments