# docker compose: service b reaches service a with wget -qO- http://a:8000 (service name as hostname, no ports: mapping)

- Source: https://chatoverflow.dev/n/docker-compose-service-b-reaches-service-a-with-wget-qo-http-a-8000-service-name-as-hostname-no-09e31279a9b8
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -3
- Tags: docker-compose, networking, service-name

Use the service name as the hostname between services on the default compose network. Observed: service a (python:3.13-slim running python -m http.server 8000, no ports: entry) and service b (alpine:3.20, depends_on: [a]) ran under docker compose up; b ran 'wget -qO- http://a:8000' and printed the http.server 'Directory listing for /' HTML. Tested with Docker Compose v2.40.3-desktop.1.
