@@ -34,6 +34,7 @@ x-backend: &backend
3434 environment : &backend_environment
3535 << : *env
3636 REDIS_URL : redis://redis:6379/
37+ ANYCABLE_REDIS_SENTINELS : :any_secret@redis-sentinel:26379
3738 DATABASE_URL : postgres://postgres:postgres@postgres:5432
3839 CHROME_URL : http://chrome:3333
3940 BOOTSNAP_CACHE_DIR : /usr/local/bundle/_bootsnap
@@ -66,6 +67,8 @@ services:
6667 << : *backend_environment
6768 APP_HOST : anycable.test
6869 ANYCABLE_RPC_HOST : 0.0.0.0:50051
70+ # Do not use sentinels in tests
71+ ANYCABLE_REDIS_SENTINELS : " "
6972 CABLE_URL : " ws://ws.anycable.test:8080/cable"
7073 depends_on :
7174 << : *backend_depends_on
@@ -83,12 +86,16 @@ services:
8386 command : bundle exec sidekiq -C config/sidekiq.yml
8487
8588 ws : &ws
86- image : anycable/anycable-go:1.0
89+ image : anycable/anycable-go:edge
8790 ports :
8891 - ' 8080:8080'
92+ volumes :
93+ - ./bin/:/usr/local/bin
8994 environment : &ws_environment
9095 ANYCABLE_HOST : " 0.0.0.0"
9196 ANYCABLE_REDIS_URL : redis://redis:6379/0
97+ ANYCABLE_REDIS_SENTINELS : :any_secret@redis-sentinel:26379
98+ ANYCABLE_REDIS_SENTINEL_DISCOVERY_INTERVAL : 2
9299 ANYCABLE_RPC_HOST : anycable:50051
93100 ANYCABLE_DEBUG : 1
94101 depends_on :
@@ -148,6 +155,34 @@ services:
148155 timeout : 3s
149156 retries : 30
150157
158+ redis-slave :
159+ image : redis:5.0-alpine
160+ command : redis-server --slaveof redis 6379
161+ depends_on :
162+ redis :
163+ condition : service_healthy
164+ volumes :
165+ - redis:/data
166+
167+ redis-sentinel :
168+ image : redis:5.0-alpine
169+ volumes :
170+ - ./.dockerdev/redis-sentinel:/redis
171+ working_dir : /redis
172+ entrypoint : ./entrypoint.sh
173+ environment :
174+ SENTINEL_QUORUM : 2
175+ SENTINEL_DOWN_AFTER : 1000
176+ SENTINEL_FAILOVER : 1000
177+ SENTINEL_MASTER : redis
178+ ports :
179+ - 26379
180+ depends_on :
181+ redis :
182+ condition : service_started
183+ redis-slave :
184+ condition : service_started
185+
151186 webpacker :
152187 << : *app
153188 command : ./bin/webpack-dev-server
0 commit comments