01Compose networkingServices could not rely on host-style addressing
ProblemContainers communicate through the Compose network, so service names and internal ports must be correct.
FixUsed the Compose service names and container-facing ports consistently between NGINX, the web service and Redis.
02Shared stateScaling the web layer could not duplicate state
ProblemKeeping the counter inside one web container would make results depend on which replica received the request.
FixMoved the counter to Redis so all three web containers use the same shared state.
03Traffic routingThe scaled containers needed one entry point
ProblemClients should not need to know about individual application containers.
FixPlaced NGINX in front of the web service and routed external requests through the proxy.
Outcome.
Requests could be distributed through NGINX while all three web containers used the same Redis-backed counter state. The project demonstrated the separation between routing, application replicas and shared data inside a Docker Compose network.