Can't access nginx webpage in docker from network client

Hi Community,
I’m new to docker and nginx and I hope I created the post in the correct category.

I have a raspberry pi running docker and created a nginx stack + container with docker compose:
services:
nginx:
image: nginx:latest
ports:
- “8080:80”
volumes:
- /usr/share/nginx/html:/usr/share/nginx/html
restart: always

The index.html contains a simple hello world.

Docker deployed it on 172.20.0.1.
I can access it from the raspberry pi with http://172.20.0.1 as well as localhost:8080

Now I would like to access the webpage from my windows pc or macbook from the same network but I’m not able to open it when I try to open http://172.20.1 as well as http://RASPBERRY_IP or http://RASPBERRY_IP:8080

Did i maybe setup the container incorrectly?

TiA for any responses.

Regards D

Those IPs are private IPs on the RasPi, not available o the network. You need to use the IP which you use to connect via SSH to it. You can run hostname -I on RasPi to list all IPs used on the device.

hostname -I
192.168.0.243 172.17.0.1 172.20.0.1

ssh connection to 192.168.0.243 works fine but when I try to open http:192.168.0.243 or http:192.168.0.243:8080 it doesn’t work and I get ERR_ADDRESS_UNREACHABLE

interesting…when I open 192.168.0.243:8080 on my iPhone or windows pc - it works. When I open it on my macbook. it doesn’t work. The devices are all in the same network at home.