

Are you sure both containers (npm and audiobookshelf) are in the same network? I see you don’t specify the network in the NPM compose file.
Check that like this:
$ docker inspect container-name| grep -A3 Networks
"Networks": {
"network_name": {
"IPAMConfig": null,
"Links": null,
See if both your containers are in the same network - they should be.
There’s no conflict regarding ports. Each container can have the same ports open. You’re thinking about the host network here, but it’s not the case.