Can't access docker compose service in a job #26650
-
Hi, I have a job that start a DB container with docker compose up and then runs integration tests on it:
the docker compose look like:
and the tests are configured to run on 127.0.0.1:5434 but I get ECONNREFUSED |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
Your test runs in another container so
|
Beta Was this translation helpful? Give feedback.
-
Thanks, I’ll try the action you mentioned. |
Beta Was this translation helpful? Give feedback.
-
Using actions/setup-node did the trick, appreciate your help! |
Beta Was this translation helpful? Give feedback.
-
Nice!! Thanks for circling back on this @alexkubica 👏t2: Glad to see your first post in the forum was solved! Please pay-it-forward and come back and help others. @airtower-luna thank you for all your brilliant contributions ❤️ |
Beta Was this translation helpful? Give feedback.
-
I am having a similar issue where I have a runner that triggers a docker compose image, but then after it is up I cannot access one of the services on http://localhost:26657. After the docker image comes up I try and test it by using curl, but get error "cannot connect". This setup works locally. I tried setting network_mode host on the docker-compose.yaml file but it did nothing. I was thinking that this, "Put the test container onto the same network as the Docker Compose containers and access them by name", might fix it but don't know how to configure that.
|
Beta Was this translation helpful? Give feedback.
Your test runs in another container so
127.0.0.1
is that container, which doesn’t have any running service. I see three ways to fix this (pick one):actions/setup-node
and run the tests directly on the runner VM.