Skip to content

Commit 9bab12f

Browse files
committed
fix: docker compose command syntax and entrypoint issues
1 parent e00165a commit 9bab12f

File tree

1 file changed

+86
-81
lines changed

1 file changed

+86
-81
lines changed

docker-compose.yml

Lines changed: 86 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,25 @@ services:
4343
condition: service_healthy
4444
environment:
4545
REDIS_ENTERPRISE_URL: "https://enterprise:9443"
46+
REDIS_ENTERPRISE_INSECURE: "true"
4647
RUST_LOG: ${RUST_LOG:-info}
4748
networks:
4849
- redis-net
49-
entrypoint: ["/bin/sh", "-c"]
50-
command: |
51-
echo "========================================" &&
52-
echo "Step 1: Initializing Redis Enterprise cluster..." &&
53-
echo "========================================" &&
54-
55-
redisctl enterprise workflow init-cluster \
56-
--insecure \
57-
--name "test-cluster" \
58-
--username "[email protected]" \
59-
--password "Redis123!" \
60-
--accept-eula &&
61-
62-
echo "✓ Cluster initialized successfully" &&
63-
echo ""
50+
entrypoint:
51+
- /bin/sh
52+
- -c
53+
- |
54+
echo "========================================"
55+
echo "Step 1: Initializing Redis Enterprise cluster..."
56+
echo "========================================"
57+
58+
redisctl enterprise bootstrap create \
59+
--name "test-cluster" \
60+
--username "[email protected]" \
61+
--password "Redis123!"
62+
63+
echo "✓ Cluster initialized successfully"
64+
echo ""
6465
6566
# Create database
6667
create-db:
@@ -76,23 +77,23 @@ services:
7677
REDIS_ENTERPRISE_URL: "https://enterprise:9443"
7778
REDIS_ENTERPRISE_USER: "[email protected]"
7879
REDIS_ENTERPRISE_PASSWORD: "Redis123!"
80+
REDIS_ENTERPRISE_INSECURE: "true"
7981
RUST_LOG: ${RUST_LOG:-info}
8082
networks:
8183
- redis-net
82-
entrypoint: ["/bin/sh", "-c"]
83-
command: |
84-
echo "========================================" &&
85-
echo "Step 2: Creating test database..." &&
86-
echo "========================================" &&
87-
88-
redisctl enterprise workflow create-database \
89-
--insecure \
90-
--name "test-db" \
91-
--memory 100MB \
92-
--port 12000 &&
93-
94-
echo "✓ Database created successfully" &&
95-
echo ""
84+
entrypoint:
85+
- /bin/sh
86+
- -c
87+
- |
88+
echo "========================================"
89+
echo "Step 2: Creating test database..."
90+
echo "========================================"
91+
92+
redisctl enterprise database create test-db \
93+
--memory-limit 100
94+
95+
echo "✓ Database created successfully"
96+
echo ""
9697
9798
# Validate API
9899
validate-api:
@@ -108,28 +109,31 @@ services:
108109
REDIS_ENTERPRISE_URL: "https://enterprise:9443"
109110
REDIS_ENTERPRISE_USER: "[email protected]"
110111
REDIS_ENTERPRISE_PASSWORD: "Redis123!"
112+
REDIS_ENTERPRISE_INSECURE: "true"
111113
RUST_LOG: ${RUST_LOG:-info}
112114
networks:
113115
- redis-net
114-
entrypoint: ["/bin/sh", "-c"]
115-
command: |
116-
echo "========================================" &&
117-
echo "Step 3: Validating API endpoints..." &&
118-
echo "========================================" &&
119-
120-
echo "→ Listing databases..." &&
121-
redisctl enterprise database list --insecure --output table &&
122-
123-
echo "" &&
124-
echo "→ Getting database info..." &&
125-
redisctl enterprise database get 1 --insecure --output json | head -20 &&
126-
127-
echo "" &&
128-
echo "→ Checking cluster info..." &&
129-
redisctl enterprise cluster info --insecure --query "name" &&
130-
131-
echo "✓ API validation successful" &&
132-
echo ""
116+
entrypoint:
117+
- /bin/sh
118+
- -c
119+
- |
120+
echo "========================================"
121+
echo "Step 3: Validating API endpoints..."
122+
echo "========================================"
123+
124+
echo "→ Listing databases..."
125+
redisctl --output table enterprise database list
126+
127+
echo ""
128+
echo "→ Getting database info..."
129+
redisctl --output json enterprise database show 1 | head -20
130+
131+
echo ""
132+
echo "→ Checking cluster info..."
133+
redisctl --query "name" enterprise cluster info
134+
135+
echo "✓ API validation successful"
136+
echo ""
133137
134138
# Test Redis connection
135139
test-redis:
@@ -141,39 +145,40 @@ services:
141145
condition: service_completed_successfully
142146
networks:
143147
- redis-net
144-
command: |
145-
sh -c '
146-
echo "========================================" &&
147-
echo "Step 4: Testing Redis connection..." &&
148-
echo "========================================" &&
149-
150-
# Wait for database to be fully ready
151-
sleep 5 &&
152-
153-
echo "→ Setting test key..." &&
154-
redis-cli -h enterprise -p 12000 SET test:key "Hello from Docker!" &&
155-
156-
echo "→ Getting test key..." &&
157-
redis-cli -h enterprise -p 12000 GET test:key &&
158-
159-
echo "→ Running PING..." &&
160-
redis-cli -h enterprise -p 12000 PING &&
161-
162-
echo "→ Getting INFO..." &&
163-
redis-cli -h enterprise -p 12000 INFO server | head -10 &&
164-
165-
echo "" &&
166-
echo "========================================" &&
167-
echo "✅ All tests passed successfully!" &&
168-
echo "" &&
169-
echo "Web UI: https://localhost:8443" &&
170-
echo "Username: [email protected]" &&
171-
echo "Password: Redis123!" &&
172-
echo "" &&
173-
echo "API: https://localhost:9443" &&
174-
echo "Database: redis://localhost:12000" &&
175-
echo "========================================"
176-
'
148+
command:
149+
- sh
150+
- -c
151+
- |
152+
echo "========================================"
153+
echo "Step 4: Testing Redis connection..."
154+
echo "========================================"
155+
156+
# Wait for database to be fully ready
157+
sleep 5
158+
159+
echo "→ Setting test key..."
160+
redis-cli -h enterprise -p 12000 SET test:key "Hello from Docker!"
161+
162+
echo "→ Getting test key..."
163+
redis-cli -h enterprise -p 12000 GET test:key
164+
165+
echo "→ Running PING..."
166+
redis-cli -h enterprise -p 12000 PING
167+
168+
echo "→ Getting INFO..."
169+
redis-cli -h enterprise -p 12000 INFO server | head -10
170+
171+
echo ""
172+
echo "========================================"
173+
echo "✅ All tests passed successfully!"
174+
echo ""
175+
echo "Web UI: https://localhost:8443"
176+
echo "Username: [email protected]"
177+
echo "Password: Redis123!"
178+
echo ""
179+
echo "API: https://localhost:9443"
180+
echo "Database: redis://localhost:12000"
181+
echo "========================================"
177182
178183
networks:
179184
redis-net:

0 commit comments

Comments
 (0)