Search code examples
dockerdocker-composecouchbase

Connection issues when using newer docker compose versions with Couchbase


Im having trouble setting up a local multimode Couchbase cluster via docker compose. I am using a docker compose file to setup 3 nodes on my local machine. It works fine with the old docker compose style but when using newer ones I can't connect to localhost:8091. Im on macOS using apple silicon (m1). Im fairly new to docker so I don't really know what could be the issue. working version:

couchbase1:
  image: couchbase/server:community-aarch64
  volumes:
    - ~/couchbase/node1:/opt/couchbase/var
couchbase2:
  image: couchbase/server:community-aarch64
  volumes:
    - ~/couchbase/node2:/opt/couchbase/var
couchbase3:
  image: couchbase/server:community-aarch64
  volumes:
    - ~/couchbase/node3:/opt/couchbase/var
  ports:
    - 8091-8097:8091-8097
    - 9140:9140
    - 11207:11207 
    - 18091-18097:18091-18097
    - 11210:11210

not working:

version: '3.5'

services:
  couchbase1:
    image: couchbase/server:community-aarch64
    volumes:
      - ~/couchbase/node1:/opt/couchbase/var
    networks:
    - proxynet
  couchbase2:
    image: couchbase/server:community-aarch64
    volumes:
      - ~/couchbase/node2:/opt/couchbase/var
    networks:
    - proxynet
  couchbase3:
    image: couchbase/server:community-aarch64
    volumes:
      - ~/couchbase/node3:/opt/couchbase/var
    ports:
      - 8091-8097:8091-8097
      - 9140:9140
      - 11207:11207 
      - 18091-18097:18091-18097
      - 11210:11210
    networks:
      - proxynet
networks:
  proxynet:
    name: custom_network

Solution

  • Never mind ist actually does Work, it just takes for ages to start up. Even if the containers are running, if you wait for a while it works.