Separate instances of Dgraph (Docker question)

@good-idea

Are you doing this?

This was the key for me to have both run with no issues.

Below are my two configs, which have been working for me since March.

docker-compose -f docker-compose.dev.yml -p dgraph-dev up -d
docker-compose -f docker-compose.test.yml -p dgraph-test up -d

dgraph-dev

version: "3.2"
services:
  zero:
    image: dgraph/dgraph:v1.0.5
    volumes:
      - type: volume
        source: dgraph
        target: /dgraph
        volume:
          nocopy: true
    ports:
      - 5080:5080
      - 6080:6080
    restart: on-failure
    command: dgraph zero --my=zero:5080
  server:
    image: dgraph/dgraph:v1.0.5
    volumes:
      - type: volume
        source: dgraph
        target: /dgraph
        volume:
          nocopy: true
    ports:
      - 8080:8080
      - 9080:9080
    restart: on-failure
    command: dgraph server --my=server:7080 --lru_mb=2048 --zero=zero:5080
  ratel:
    image: dgraph/dgraph:v1.0.5
    volumes:
      - type: volume
        source: dgraph
        target: /dgraph
        volume:
          nocopy: true
    ports:
      - 8000:8000
    command: dgraph-ratel

volumes:
  dgraph:

dgraph-test

version: "3.2"
services:
  zero-test:
    image: dgraph/dgraph:v1.0.5
    volumes:
      - type: volume
        source: dgraph-test
        target: /dgraph-test
        volume:
          nocopy: true
    ports:
      - 6081:6081
      - 5081:5081
    restart: on-failure
    command: dgraph zero --port_offset 1 --my=zero-test:5081
  server-test:
    image: dgraph/dgraph:v1.0.5
    volumes:
      - type: volume
        source: dgraph-test
        target: /dgraph-test
        volume:
          nocopy: true
    ports:
      - 8081:8081
      - 9081:9081
    restart: on-failure
    command: dgraph server --my=server-test:7081 --lru_mb=1024 --zero=zero-test:5081 -o 1

volumes:
  dgraph-test:
1 Like