Can't connect to localhost:8080 from CI

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 failed, reason: connect ECONNREFUSED

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.