OK, guys I know this is not really Dgraph specifically, but following every tutorial I have found, I can’t seem to get graphql endpoint to be served on a different port, for instance 8081.
Here is a regular working docker-compose.yml on port 8080 normally.
version: "3.2"
services:
reverse-proxy:
image: traefik:v2.2
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.dgraph.address=:"8080"
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
zero:
image: dgraph/dgraph:master
volumes:
- /dgraph/data:/dgraph
restart: always
command: dgraph zero --my=zero:5080
alpha:
image: dgraph/dgraph:master
volumes:
- /dgraph/data:dgraph
labels:
- "traefik.enable=true"
- "traefik.http.middlewars.adminIps.ipwhitelist.sourcerange=1.1.1.1" #My actual ip address
- "traefik.htto.routers.alpha.rule=Host(`mydomain.com`) && Path(`/graphql`)"
- "traefik.http.routers.all.rule=Host(`mydomain.com`)"
- "traefik.http.routers.all.middlewares=adminIps@docker"
- "traefik.http.routers.all.entrypoints=dgraph"
restart: always
command: dgraph alpha --my=alpha:7080 --zero=zero:5080 --whitelist 172.0.0.0:172.254.254.254
I have tried by just changing the received port:
- "8081:8080"
but that does not even seem to open the port 8081. Next I reversed that change and tried to make everything 8081 on the received and then add a load balancer on the received image with lable:
- "--entrypoints.dgraph.address=:"8081"
...
- "8081:8081"
# after "traefik.http.routers.all.entrypoints=dgraph"
- "traefik.http.services.alpha.loadbalancer.server.port=8080"
But again this seems to not open port 8081.
Does anyone have experience with traefik that can offer some pointers of where I am going wrong? I am wanting to do some more advanced options by pointing 80 at 443 which I want to secure with letsencrypt and then point that at 8080 graphql endpoint. But in order to do all of this, I need to be able to do this simple port forwarding and figured 8081->8080 would be an easy task. Well, so much for that
Again, I know not specifically Dgraph (at least I don’t think) so if I need to post elsewhere I will.