title: Go app cannot connect over websocket inside docker-compose
body: <p>So I have a very simple app written in Go, that needs to connect to the database over a websocket. This works fine when I run the database inside a container and expose the required ports via <code>docker run -d -p 8182:8182 tinkerpop/gremlin-server</code>, with the app locally pointing at localhost:8182.</p>
  <p>However I now want to run both inside containers via compose for CI, and my app cannot find the database. I've tried using docker hostnames, IP addresses, and listening on 0.0.0.0 to no avail. Currently my compose looks like this:</p>
  <pre><code>version: '3'
  
  services:
    db:
      image: tinkerpop/gremlin-server
      hostname: gremlin
      ports:
        - 8182:8182
    server:
      build: .
      environment:
        ORBITAL_DB_ADDRESS: &quot;ws://gremlin:8182&quot;
      ports:
      - 5000:5000
      depends_on:
        - db
  </code></pre>
  <p>However I seem to only get the following message from my app container:  <code>dial tcp: lookup gremlin on 127.0.0.11:53: no such host</code>.</p>
  <p>This is despite my app set to ListenAndServe on 0.0.0.0:</p>
  <pre><code>err := http.ListenAndServe(fmt.Sprintf(&quot;0.0.0.0:%d&quot;, conf.Service.Port), nil)
  </code></pre>
  <p>Any help would be much appreciated. Thanks.</p>