feat(docker): make gateway bind address configurable
This commit is contained in:
parent
6d69ba9272
commit
5c84d587f9
@ -7,7 +7,7 @@
|
||||
# Build image:
|
||||
# docker build -t picobot .
|
||||
#
|
||||
# Run gateway: docker run -d -v ~/.picobot:/app/.picobot -p 19876:19876 picobot gateway
|
||||
# Run gateway: docker run -d -v ~/.picobot:/app/.picobot -p 19876:19876 picobot gateway --host 0.0.0.0
|
||||
# Run chat: docker run -it -v ~/.picobot:/app/.picobot picobot chat
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@ -4,14 +4,19 @@ services:
|
||||
container_name: picobot
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "19876:19876"
|
||||
- "${PICOBOT_PUBLISH_HOST:-0.0.0.0}:${PICOBOT_GATEWAY_PORT:-19876}:${PICOBOT_GATEWAY_PORT:-19876}"
|
||||
volumes:
|
||||
- ~/.picobot/config.json:/app/.picobot/config.json:ro
|
||||
- picobot_data:/app/.picobot
|
||||
environment:
|
||||
- RUST_LOG=info
|
||||
- TZ=Asia/Shanghai
|
||||
command: gateway
|
||||
command:
|
||||
- gateway
|
||||
- --host
|
||||
- ${PICOBOT_GATEWAY_HOST:-0.0.0.0}
|
||||
- --port
|
||||
- ${PICOBOT_GATEWAY_PORT:-19876}
|
||||
|
||||
volumes:
|
||||
picobot_data:
|
||||
|
||||
@ -7,6 +7,12 @@ cargo build
|
||||
# 启动网关 (默认 127.0.0.1:19876)
|
||||
cargo run -- gateway
|
||||
|
||||
# 覆盖监听地址和端口
|
||||
cargo run -- gateway --host 0.0.0.0 --port 19876
|
||||
|
||||
# Docker Compose 默认监听并发布 0.0.0.0:19876;也可分别覆盖
|
||||
PICOBOT_GATEWAY_HOST=0.0.0.0 PICOBOT_PUBLISH_HOST=192.168.1.10 PICOBOT_GATEWAY_PORT=19876 docker compose up -d
|
||||
|
||||
# WebUI 随 Gateway 提供,浏览器打开
|
||||
# http://127.0.0.1:19876/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user