在单个主机IP地址上托管Node程序

时间:2020-08-30 19:27:09

标签: node.js docker docker-compose containers production

如果我尝试在Docker中托管Node程序,它将分配给0.0.0.0:80,但这将分配给所有IP地址

我想将docker容器分配给我的VPS的单个特定IP地址

我尝试在-p上指定:

docker run -p xxx.xxx.xxx.xxx:80:80 docker-image

但是会出现节点错误:

NodeJS - Error: listen EADDRNOTAVAIL: address not available

0 个答案:

没有答案