docker-compose 暴露一段端口启动失败
使用docker-compose启动容器的时候,我配置了一段端口的映射
ports:
- "49152-65535:49152-65535"
- "49152-65535:49152-65535/udp"
导致在启动的时候出现超时情况。
ERROR: for coturn_coturn_1 UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=120)
ERROR: for coturn UnixHTTPConnectionPool(host='localhost', port=None): Read timed out. (read timeout=120)
ERROR: An HTTP request took too long to complete. Retry with --verbose to obtain debug information.
If you encounter this issue regularly because of slow network conditions, consider setting COMPOSE_HTTP_TIMEOUT to a higher value (current value: 120).
我将端口段缩小之后,可以正常启动。
- "65000-65535:65000-65535"
- "65000-65535:65000-65535/udp"
初步怀疑是映射的端口较多,导致启动慢。我已经将超时时间设置为120了。
目前我还是需要使用49152-65535这一段端口,有一种办法是将超时时间继续设长,但是否还有其他方法可以解决?