(01)Start all services
Linux
1docker compose up -d --build2curl http://localhost:3000/ping # api → ping-service via internal DNS3curl http://localhost:5000 # isolated service onlyThree services across two Docker networks — internal DNS and network isolation demo
docker-compose.yml
api-service (exposed), ping-service (internal only), isolated-service (separate network)
1services:2 api-service:3 build: ./api-service4 container_name: api-service5 ports:6 - "3000:3000"7 networks:8 - app-network9 10 ping-service:11 build: ./ping-service12 container_name: ping-service13 networks:14 - app-network15 16 isolated-service:17 build: ./ping-service18 container_name: isolated-service19 ports:20 - "5000:4000"21 networks:22 - isolated-network23 24networks:25 app-network:26 driver: bridge27 name: app-network28 isolated-network:29 driver: bridge30 name: isolated-networkStep 01
1docker compose up -d --build2curl http://localhost:3000/ping # api → ping-service via internal DNS3curl http://localhost:5000 # isolated service only