lib/generators/anycable/setup/setup_generator.rb in anycable-rails-1.0.0.rc2 vs lib/generators/anycable/setup/setup_generator.rb in anycable-rails-1.0.0.rc3
- old
+ new
@@ -157,10 +157,13 @@
res
end
end
def install_for_docker
+ # Remove localhost from configuraiton
+ gsub_file "config/anycable.yml", /^.*redis_url:.*localhost[^\n]+\n/, ""
+
say_status :help, "️️⚠️ Docker development configuration could vary", :yellow
say "Here is an example snippet for docker-compose.yml:"
say <<~YML
─────────────────────────────────────────
@@ -172,21 +175,26 @@
ANYCABLE_HOST: "0.0.0.0"
ANYCABLE_REDIS_URL: redis://redis:6379/0
ANYCABLE_RPC_HOST: anycable:50051
ANYCABLE_DEBUG: 1
depends_on:
- - anycable
- - redis
+ redis:
+ condition: service_healthy
anycable:
<<: *backend
command: bundle exec anycable
environment:
<<: *backend_environment
ANYCABLE_REDIS_URL: redis://redis:6379/0
ANYCABLE_RPC_HOST: 0.0.0.0:50051
+ ANYCABLE_DEBUG: 1
ports:
- '50051'
+ depends_on:
+ <<: *backend_depends_on
+ ws:
+ condition: service_started
─────────────────────────────────────────
YML
end
def install_for_local