couchdb-docker-service icon indicating copy to clipboard operation
couchdb-docker-service copied to clipboard

Support multiple service names and ports

Open robertgartman opened this issue 8 years ago • 1 comments
trafficstars

Great work! The cluster setup deserves a bunch of stars on its own.

We have the need of running multiple environments (e.g. dev, int, prod etc.). There are places in the code where service name and port are hardcoded. It would be just sweet if those could be parameterised as well. Example:

    curl -X PUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@couchdb1:5984/_users
    curl -X PUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@couchdb1:5984/_replicator
    curl -X PUT http://$COUCHDB_USER:$COUCHDB_PASSWORD@couchdb1:5984/_global_changes

Given the Swarm setup, each service need their own port. Forking is of course an alternative but better yet would be if this service definition becomes the de facto standard for couchdb and swarm.

The use case I think of is to launch multiple services in the same Swarm by altering the service name and port.

docker service create --replicas 2 --name dev_couchdb --network couchdb-network \
   < cut >
  -p 5983:5984 \
  redgeoff/couchdb-service

docker service create --replicas 2 --name int_couchdb --network couchdb-network \
   < cut >
  -p 5984:5984 \
  redgeoff/couchdb-service

robertgartman avatar Jul 22 '17 20:07 robertgartman

Thanks, @robertgartman! Yeah, I completely agree that those areas should be made configurable. Any chance you want to submit a PR and I'll code review it?

redgeoff avatar Jul 24 '17 18:07 redgeoff