Hello I wanted to build a new container with my docker-compose.yml and it worked so far:
version: '2.4'
services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
- PORT=8080
volumes:
- ../../:/workspaces:cached
command: sleep infinity
db:
image: mariadb:11.1
restart: always
environment:
MARIADB_DATABASE: ****
MARIADB_USER: ****
MARIADB_PASSWORD: ****
MARIADB_ROOT_PASSWORD: ****
volumes:
- ****DevDB:/var/lib/mysql
db-testing:
image: mariadb:11.1
restart: always
environment:
MARIADB_DATABASE: ****-testing
MARIADB_USER: ****
MARIADB_PASSWORD: ****
MARIADB_ROOT_PASSWORD: ****
volumes:
- ****TestDB:/var/lib/mysql
ports:
- "3309:3306"
volumes:
****DevDB:
****TestDB:
But I am not able to connect via VSCode and my Plugin to that container. When I try to, I get: “Connection error! connect ECONNREFUSED 172.18.0.2:3309”.
But the container is definately build. And when I call “docker ps” it is listed. And even when I want to get in to that container with “docker exec -it container_name bash” it works. But somehow I cannot connect with my plugin, while I am able all the time to connect to the older container for my productive database. I did the exact same for both.
To my setup:
Everything is hosted on a server and I am connected my terminal and my IDE VSCode to it via SSH. And on that machine are my containers running. So there should not be a problem caused by firewall settings or something like that. Everything is on that machine.
I think it is just a trivial solution, but I really can’t see it and it makes me crazy somehow.