I'm not sure exactly whats wrong, but here are a few things I'd check:
Application Errors: There might be errors in your application that prevent it from starting. Check the container logs for any error messages (It looks like you did this though):
docker logs <container_id>
Port Binding: Ensure that the port 3000 is correctly exposed and mapped. Verify the port mapping with:
docker inspect <container_id>
Network Configuration: Ensure that the network configuration allows access to the container. Sometimes, firewall rules or Docker network settings can block access. I've run into this problem a few times myself.
Command Issues: The CMD instruction in your Dockerfile might not be starting the application correctly. Verify that npx nx serve ebook-app works as expected outside of Docker. I usually use a web server like nginx so I'm not sure about your commands there.
File Permissions: Ensure that the application files have the correct permissions and are accessible by the ebook-app user. It looks like you are setting them correctly, but it might be worth verifying.
Dependency Issues: Ensure that all dependencies are correctly installed and there are no missing or incompatible packages. It seems from your question that there were no issues with the run npm install command, but its possible there was an issue there and maybe your logging level isn't showing it?
Give these a try and best of luck with the e-book development!