Communicate between containerized projects

Uthpala Pathirana
2 min readJun 21, 2019
Photo by Kaique Rocha from Pexels

It appeared that I’ve succeeded in containerizing multiple projects. I was wrong as the challenges were endless.

Will the data still be displayed after request/response communication of Client -> API and API -> DB? I simply tried with my normal configuration which didn’t work.
Let’s see how we can prepare them to run in 📦s. Alarming you that I’m still not dealing with docker-compose.

  1. Connectionstring — write the IP and port (default for MSSQL is 1433, MySQL is 3306). If it’s your machine, state your IP.

. and (local) won’t work since the container will look for it’s own dbserver which is not present.

2. URLs — state these using IPs again.
Consider a container as another host in your network. He’ll need to know which host he has to request from.

More Tips

  1. Tag the image, name the container as a good practice 😊
  2. To view logs of a container: docker logs -f Container-ID
  3. To simply copy any file from the running container to your machine: docker cp Container-ID:/foo.txt foo.txt

Previous post: containerizing-an-application-of-multiple-startup-projects-without-docker-compose-visual-studio

Comment if anyone needs help to containerize an Angular app 😉

--

--

Uthpala Pathirana

Someone who loves heavy rain-fall on a night and mild sun shine the following morning. Passion for travelling, reading & dancing. A typical dev.