Kamal 2 w/ multiple gRPC servers
Purpose
Add multi‑host deployment of AnyCable Rails Demo with:
- Horizontal scaling of
Railsweb,AnyCable RPC, andAnyCable‑Goprocesses across multiple hosts - Static RPC list (
grpc-list://) - Centralized configuration via
.envand Kamal secrets
Changes
-
Multi‑stage Docker build
-
Kamal 2 deployment
config/deploy.ymldeclaresweb,rpc,anycable‑go,db, andredisroles/accessories.kamal/hooks/pre-app-bootstops existingrpccontainers to avoid port collisions.kamal/secrets.samplemapsRAILS_MASTER_KEY,POSTGRES_PASSWORD,DATABASE_URL, andREDIS_PASSWORD
-
Environment management
- Added
.env.samplelisting all parameters - Added gem
dotenvto load.envindeploy.yml
- Added
-
Entrypoint script (
bin/docker-entrypoint)- Automatically runs
rails db:prepareon server start
- Automatically runs
-
Healthcheck endpoint
- GET
/upreturns HTTP 200 for Kamal’s proxy health checks
- GET
This also leverages AnyCable Go 1.6.2’s grpc-list:// feature to pass a static list of RPC endpoints
Setup and Deploy:
- Copy and fill samples
cp .env.sample .env
cp .kamal/secrets.sample .kamal/secrets
# Fill in all values (.env, .kamal/secrets)
- Local dev (Docker Compose)
dip provision
dip up web
- Production (Kamal)
kamal setup # or kamal deploy after the setup
If I do t need massive scale, and just want to reliably use actioncable in a chrome extension, do I need production any cable, or should I be good with a kamal accessory?
Hey @adenta,
It sounds like in your case using AnyCable Thruster could be the simplest option. Check it out.
Do you use AnyCable RPC? You may also consider running it in the embedded mode or via HTTP, so no additional services required.