title: Apollo Federation cannot get connection running in docker-compose: Couldn't load service definitions for...reason: connect ECONNREFUSED 127.0.0.1:80
body: <p>I am trying to run two applications by docker-compose without success, the federation cannot connect on service. Both works well out of docker.</p>
  <p>Below follow the projects:</p>
  <ul>
  <li><p>Apollo Server Federation in NodeJS</p>
  </li>
  <li><p>GraphQL API In Kotlin + Spring Boot + expediagroup:graphql-kotlin-spring-server</p>
  </li>
  </ul>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>version: '3'
  services:
    myservice:
      image: 'myservice:0.0.1-SNAPSHOT'
      container_name: myservice_container
      ports:
        - 8080:8080
      expose:
        - 8080
    apollo_federation:
      image: 'apollo-federation'
      build: '.'
      container_name: apollo_federation_container
      restart: always
      ports:
        - 4000:4000
      expose:
        - 4000
      environment:
        ENDPOINT: &quot;http://myservice/graphql&quot;
      depends_on:
        - myservice
  </code></pre>
  <p>I already try a lot of combinations in my endpoint ex: http://myservice:8080/graphql, http://localhost:8080/graphql, http://myservice, etc...</p>
  <p><strong>index.js from Apollo Project</strong></p>
  <pre><code>const { ApolloServer } = require(&quot;apollo-server&quot;);
  const { ApolloGateway } = require(&quot;@apollo/gateway&quot;);
  
  const gateway = new ApolloGateway({
    serviceList: [
      { name: &quot;Service1&quot;, url: process.env.ENDPOINT || 'http://localhost:8080/graphql' },
    ]
  });
  
  const server = new ApolloServer({
    gateway,
    subscriptions: false
  });
  
  server.listen().then(({ url }) =&gt; {
    console.log(` Server ready at ${url}`);
  })
  </code></pre>
  <p><strong>Error Log</strong></p>
  <pre><code> Error checking for changes to service definitions: Couldn't load service definitions for &quot;Service1&quot; at http://myservice/graphql: request to http://myservice/graphql failed, reason: connect ECONNREFUSED 172.18.0.3:80
  </code></pre>
  <p>if I try to test from browse I get a error 500 by graphiql.</p>
  <p>I am already tried to use a nginx as reverse-proxy, but no success</p>
  <p>I am using the last libs in projects.</p>
  <p>Thanks</p>