I use Docker and Docker-Compose to run integration tests. This works well locally, however in the circle ci Step this is failing due to my test suite not being able to connect to the mongo host.
I suspect there is something weird going on due to being inside the docker container that circle provide through this step:
- setup_remote_docker: docker_layer_caching: true
I see this error:
java.net.ConnectException: Connection refused
Wrapped by: com.mongodb.MongoSocketOpenException: Exception opening socket
My docker-compose looks like:
version: '3.6' services: app: container_name: tvr-app environment: INTEGRATION_TEST: INTEGRATION_TEST MONGO_HOSTS: "[mongo01]" build: context: ../../../../ dockerfile: Dockerfile args: APP_NAME: tvr-decision-engine volumes: - ./app/conf:/conf/ depends_on: - mongo01 mongo01: container_name: tvr-mongo-1 image: mongo:4.0 environment: MONGO_INITDB_ROOT_USERNAME: admin MONGO_INITDB_ROOT_PASSWORD: password MONGO_INITDB_DATABASE: test ports: - "127.25.0.3:27017:27017" command: - --bind_ip - "127.25.0.3,mongo01" - --smallfiles - --oplogSize - "128"
Please help, thanks.