Closed milas closed 2 years ago
Marked this one as a draft because I'm not sure it makes sense to include in its current state.
The sample wants two web backends, presumably to show that the state is in fact stored in Redis. It achieves this pretty hackily by duplicating the config instead of using deploy.replicas
. I tried to switch to that but I think there's a Compose enhancement needed here - DNS does not behave as expected in this case 😢
Thoughts?
@milas, I tried to use
deploy:
replicas: 2
ports:
- 81-82:5000
and remove the web2
service in compose and nginx conf, but I randomly hit a port collision between the 2 replicase 😬 (that shouldn’t happen, I'll see if we can fix that on compose side quickly)
The port bindings aren't really needed since we have the nginx proxy - remove those & launch again and then look at DNS aliases
They both get referred to as web
or their "fully qualified" name with the project name (which we can't use since we can't predict that)
I was hoping there'd be web-1
and web-2
DNS aliases to use in the nginx upstream
Regardless, the development UX is kind of weird since there will be two containers and you have to pick one arbitrarily to develop in, but then the other one will still serve ~50% of requests
Closing this - we're going to skip this one for now as it's not a good fit!
nginx
toproxy
and use bind mount for config for consistency with other examples