Hi there,
I am running a node app in circle-ci. To run my persistence tests, I need to spin up a docker image mysql 5.7 and the run migrations against it to make sure it is set up for testing.
My starting the container scripts succeeds, including pinging mysql to make sure it runs inside the docker image.
When the migration library attempts to make a connection from the base circle-ci image, I get the following error:
[ERROR] Error: connect ECONNREFUSED 127.0.0.1:3305
here is my job config:
test:
working_directory: ~/my-project
docker:
- image: circleci/node:6.10
branches:
only:
- circle-ci
steps:
- checkout
- setup_remote_docker
- attach_workspace:
at: /home/circleci/my-project
- run:
name: test
command: |
./scripts/ci/test.sh
DB config:
{
"name": "test-db",
"driver": "mysql",
"host": "127.0.0.1",
"port": 3305,
"port_mapping": "3305:3306",
"user": "test_user",
"password": "test_password",
"database": "tests"
}
And here are all the env vars in the mysql docker image:
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=44f1337d0a2f
MYSQL_RANDOM_ROOT_PASSWORD=yes
MYSQL_DATABASE=tests
MYSQL_USER=test_user
MYSQL_PASSWORD=test_password
MYSQL_ROOT_HOST=%
MYSQL_HOST=127.0.0.1
GOSU_VERSION=1.7
MYSQL_MAJOR=5.7
MYSQL_VERSION=5.7.18-1debian8
HOME=/root
This same config works fine when I set up on my local machine.
Any ideas what I am missing?
Thanks