Can't connect to localhost:8080 from CI

Hi,
I’m trying to run Jest tests during CI.
The tests need to access a docker container that I spin up using the docker-compose command.

This is the error I get:

FetchError: request to http://127.0.0.1:8080/v1/graphql failed, reason: connect ECONNREFUSED 127.0.0.1:8080

Any idea if I need to use a different IP or set the docker container under this fixed IP?

I was able to solve the problem by following these steps:
build the docker images as part of the circleci config file instead of having them in docker-compose.
Then, instead of using localhost, I used the docker image name as the address (e.g. postgres, hasura).

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.