I’ve just re-setup an old sync gateway / cb docker cloud stack that I thought used to work fine. It’s built with a dockerfile that uses couchbase/sync-gateway:1.3.1-community as its base.
When it’s up, I would then run
ssh d1 -L 127.0.0.1:4985:127.0.0.1:4985 -L 127.0.0.1:4984:127.0.0.1:4984
from my mac to get access to the admin port to test things out. However for some reason I can’t access the admin port anymore without adding these keys explicitly to the sync config.
"adminInterface": "<ADMIN_INTERFACE>",
"interface": "<INTERFACE>",
Note my entry script replaces these with the env vars in the stackfile.
sync:
autoredeploy: true
deployment_strategy: every_node
environment:
- 'ADMIN_INTERFACE=:4985'
- 'CORS_LOGIN_ORIGIN_1=http://localhost:9000'
- 'CORS_LOGIN_ORIGIN_2=http://localhost:3000'
- 'CORS_LOGIN_ORIGIN_3=http://localhost:8080'
- 'CORS_ORIGIN_1=http://localhost:9000'
- 'CORS_ORIGIN_2=http://localhost:3000'
- 'CORS_ORIGIN_3=http://localhost:8080'
- DATABASE_BUCKET=default
- DATABASE_NAME=dd
- 'DATABASE_SERVER=http://couchbase:8091'
- 'INTERFACE=:4984'
image: 'xxxxx/sync:latest'
links:
- couchbase
ports:
- '4984:4984'
- '4985:4985'
restart: on-failure
tags:
- database
volumes:
- '/tmp:/tmp/config'
This works, but the problem is I can also access the admin port from the public ip. To be honest it’s been awhile since I looked at this, so I’m not sure what way I had it setup. I may have just used firewall rules stopping it… but I wondered anyone could advise. I think my original setup was along the lines of App Server (Public IP) > Load Balancer (Public IP) > Sync Gateway (Private Network) > Couchbase (Private Network), and the load balancer could talk to the sync gateways via docker cloud links or something…
Any advice, resource links?