1

How can i access my container on Docker-Desktop from other computer ?

028872c0210d web "docker-entrypoint.s…" x hours ago | Up x hours 0.0.0.0:4200->4200/tcp web
90bcf87bbf3b api "java -jar test.jar"   x hours ago | Up x hours 0.0.0.0:2022->2022/tcp api
8b9d2f6c1340 db  "docker-entrypoint.s…" x hours ago | Up x hours 0.0.0.0:5432->5432/tcp db

I can access my app on the browser (localhost:4200) on my local machine (A) but when i'm on another computer (B) i can't access my app on docker-desktop (A) from computer (B).

What i want want is to get access to the app hosted by the computer (A | 192.168.1.18) in Docker-desktop from the browser on computer (B | 192.168.1.19). When i type 192.168.1.18:4200, (or another port), i want to access to my web-app

How can i do that ? Thank you.

Albius
  • 23
  • 5
  • I'm not super expert in networking stuff, but I guess the only way you can access app on A from B is that A and B are in the same network (like LAN). – mattiatantardini Feb 21 '23 at 16:14
  • Does this answer your question? [How to connect to a docker container from outside the host (same network) \[Windows\]](https://stackoverflow.com/questions/33814696/how-to-connect-to-a-docker-container-from-outside-the-host-same-network-windo) – George Hilliard Feb 27 '23 at 15:51
  • @GeorgeHilliard thak you for the reply but i solved my issue by allowinf traffic in the Windows Firewall :) – Albius Feb 28 '23 at 15:14

1 Answers1

0

Well issue was related to Windows, i had to allow traffic in firewall rules. My config in docker-compose was correct!

Albius
  • 23
  • 5