This exact error has one of the longest answer threads on Stack Overflow for a Docker issue, because the fixes are all reactive:
Error response from daemon: driver failed programming external connectivity
on endpoint shop_orders-api_1: Bind for 0.0.0.0:4001 failed: port is already allocated