I am trying to run some integration tests that require multiple containers to be up and running in my system. The containers communicate through a mqtt docker container, and send queries to an influxdb docker container. These require communication through http requests. When I docker-compose up the system on my local system, I am able to run the integration tests. However, in CI/CD, although in inspection of docker ps and docker-compose ps everything seems to be up and healthy, my integration tests all throw errors due to Connection Refused [Errno 111]
from my python scripts. Here is my CI config file:
image: docker:19.03
variables:
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "/certs"
services:
- name: docker:19.03-dind
alias: localhost
integration-tests:
stage: test
script:
- apk add --no-cache docker-compose
- docker-compose -f "docker-compose.replay.yml" up -d --build
- docker exec moderator-monitor_datareplay_1 bash -c 'cd src ; python integration_tests.py'
During debugging, I found that I was able to ping all the relevant containers from the data-replay container, suggesting that the addresses are configured correctly and that those containers are up and running. However, I was unable to curl influxDB:8086 from data-replay, and get a connection refused error (this works fine when running curl in my local setup). Is there some configuration problem that would allow for pings but not curl using docker-compose in this docker in docker environment?
I have tried messing around with networks/links in my docker-compose file but without any success.