Docker Community Forums

Share and learn in the Docker community.

How to use EXPOSE with networks?


(Princessjasmine) #1

Hello all =)

Can anyone figure out why I can’t curl couchdb:5984 from the stackedit container? I get connection refused, but from inside the couchdb container netstat -nl shows 127.0.0.1:5984.

What am I doing wrong?

Hugs,
Jasmine =)

version: '2'
networks:
  revproxynet:
    external: true
services:

  couchdb:
    build:
      context: ./components/couchdb
    expose:
      - "5984"
      - "6984"
    networks:
      - revproxynet

  stackedit:
    build:
      context: ./components/stackedit
    expose:
      - "3000"
    networks:
      - revproxynet

(Sam) #2

what kind of DB is couchdb? if mysql you have to allow external access.

it seems it is listening ONLY on local host 127.0.0.1, instead of global, 0.0.0.0