Hands-on task
A three-container stack: find the break
A shop stack: web (storefront) → api → db, all on izzylab/minihttp:1. The storefront is published on the server's 127.0.0.1:8080, web and api live in the front network, the database is in the back network, and db must not be reachable from web.
After a move the stack doesn't work: curl http://127.0.0.1:8080/call doesn't answer. Walk the chain, find all the breaks and fix them so that:
curl http://127.0.0.1:8080/callanswersweb -> api ok;api's/callgets an answer fromdb;webis published only on127.0.0.1:8080, anddbcan't be reached fromweb.
Don't touch db or its settings — don't recreate or restart it. web and api may be recreated or reconnected with the same names, image and NAME.
The lab has its own Docker with no internet access; the images are already loaded: izzylab/minihttp:1, alpine:3.21, busybox:1.36, nginx:1.27-alpine. izzylab/minihttp is a tiny HTTP service on port 8080: GET / answers <NAME> ok, GET /call itself goes to http://<UPSTREAM>/ and answers <NAME> -> <the neighbor's reply> (or 502), GET /env shows its settings. It is configured with the environment variables NAME, PORT, BIND (the address it listens on) and UPSTREAM.
- docker troubleshooting
- docker network
- port publishing