Chirpstack network server refuses connection

Since your docker-compose.yml file looks like the example, have you tried doing what the Readme said:

When adding the Network Server in the ChirpStack Application Server web-interface (see Network Servers), you must enter chirpstack-network-server:8000 as the Network Server hostname:IP.

If you changed the port number, then you should enter the new port number instead of 8000.