Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the URL of my Docker service?

My docker-compose.yml looks like this:

my_app:
  build: .
  net: host
  command: bin/server
  ports:
    - "3001:3001"

I start the service like this:

docker-compose up

And I can see that it is running:

my_app_1  | * Listening

But I can't figure out how to access it. None of these work:

localhost:3001
docker-machine:3001
127.0.0.1:3001
0.0.0.0:3001

How can I access my Docker service?

like image 634
cilphex Avatar asked Feb 02 '26 08:02

cilphex


1 Answers

docker inspect container_name/hash | grep Address

like image 199
Galym Avatar answered Feb 04 '26 00:02

Galym



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!