export to public
This commit is contained in:
@@ -232,6 +232,13 @@ tail -f logs/frontend.log
|
|||||||
BACKEND_PORT=9000 FRONTEND_PORT=8451 ./start.sh
|
BACKEND_PORT=9000 FRONTEND_PORT=8451 ./start.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
如果你希望脚本打印公网 IP 或域名,而不是机器的内网地址,可以额外指定:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
PUBLIC_HOST=1ian.cn ./start.sh
|
||||||
|
PUBLIC_HOST=47.93.63.204 ./start.sh
|
||||||
|
```
|
||||||
|
|
||||||
## Docker 启动
|
## Docker 启动
|
||||||
|
|
||||||
如果你希望在 Ubuntu 24.04 或其他装有 Docker 的环境中快速运行,直接使用:
|
如果你希望在 Ubuntu 24.04 或其他装有 Docker 的环境中快速运行,直接使用:
|
||||||
|
|||||||
13
start.sh
13
start.sh
@@ -132,15 +132,18 @@ fi
|
|||||||
|
|
||||||
wait_for_port "127.0.0.1" "$FRONTEND_PORT" "frontend"
|
wait_for_port "127.0.0.1" "$FRONTEND_PORT" "frontend"
|
||||||
|
|
||||||
SERVER_IP="$(hostname -I 2>/dev/null | awk '{print $1}')"
|
DISPLAY_HOST="${PUBLIC_HOST:-}"
|
||||||
if [[ -z "$SERVER_IP" ]]; then
|
if [[ -z "$DISPLAY_HOST" ]]; then
|
||||||
SERVER_IP="127.0.0.1"
|
DISPLAY_HOST="$(hostname -I 2>/dev/null | awk '{print $1}')"
|
||||||
|
fi
|
||||||
|
if [[ -z "$DISPLAY_HOST" ]]; then
|
||||||
|
DISPLAY_HOST="127.0.0.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
VPlatform started in background.
|
VPlatform started in background.
|
||||||
Frontend: http://${SERVER_IP}:${FRONTEND_PORT}
|
Frontend: http://${DISPLAY_HOST}:${FRONTEND_PORT}
|
||||||
Backend: http://${SERVER_IP}:${BACKEND_PORT}
|
Backend: http://${DISPLAY_HOST}:${BACKEND_PORT}
|
||||||
|
|
||||||
Logs:
|
Logs:
|
||||||
$BACKEND_LOG_FILE
|
$BACKEND_LOG_FILE
|
||||||
|
|||||||
Reference in New Issue
Block a user