feat: support dynamic port configuration in Docker Compose and entrypoint scripts

This commit is contained in:
shiyu
2025-12-30 15:00:22 +08:00
parent 078709b871
commit b1ea181f96
3 changed files with 5 additions and 3 deletions

View File

@@ -232,7 +232,7 @@ install_new_foxel() {
if ss -tuln | grep -q ":${new_port}\b"; then
warn "端口 $new_port 已被占用,请换一个。"
else
sed -i -E "s|\"[0-9]{1,5}:80\"|\"$new_port:80\"|" compose.yaml
sed -i -E "s|(FOXEL_HOST_PORT:-)[0-9]{1,5}|\\1$new_port|" compose.yaml
info "端口已成功修改为 $new_port"
break
fi