mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-02-06 15:10:59 +08:00
fix: 容器内流量转发
This commit is contained in:
@@ -81,8 +81,7 @@ LOG_LEVEL=INFO
|
||||
|
||||
# === Frontend (Nuxt) ===
|
||||
NUXT_PUBLIC_API_BASE_URL=http://localhost:8080
|
||||
NUXT_PUBLIC_API_BASE_URL_SSR=http://springboot:8080
|
||||
NUXT_PUBLIC_WEBSOCKET_URL=http://websocket_service:8082
|
||||
NUXT_PUBLIC_WEBSOCKET_URL=http://localhost:8082
|
||||
NUXT_PUBLIC_WEBSITE_BASE_URL=http://localhost:3000
|
||||
# 线上 & 本地均可使用
|
||||
NUXT_PUBLIC_GOOGLE_CLIENT_ID=777830451304-nt8afkkap18gui4f9entcha99unal744.apps.googleusercontent.com
|
||||
|
||||
@@ -14,7 +14,17 @@ services:
|
||||
networks:
|
||||
- openisle-network
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p$MYSQL_ROOT_PASSWORD"]
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"mysqladmin",
|
||||
"ping",
|
||||
"-h",
|
||||
"127.0.0.1",
|
||||
"-u",
|
||||
"root",
|
||||
"-p$MYSQL_ROOT_PASSWORD",
|
||||
]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 30
|
||||
@@ -45,7 +55,11 @@ services:
|
||||
- "${OPENSEARCH_METRICS_PORT:-9600}:9600"
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:9200/_cluster/health >/dev/null"]
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"curl -fsS http://127.0.0.1:9200/_cluster/health >/dev/null",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 30
|
||||
@@ -90,7 +104,6 @@ services:
|
||||
networks:
|
||||
- openisle-network
|
||||
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
container_name: openisle-redis
|
||||
@@ -219,6 +232,41 @@ services:
|
||||
profiles:
|
||||
- service
|
||||
|
||||
loopback_8080:
|
||||
image: alpine/socat
|
||||
container_name: loopback-8080
|
||||
# 监听“frontend_dev 容器自身的” 127.0.0.1:8080 → 转发到 springboot:8080
|
||||
command: ["-d","-d","-ly","TCP4-LISTEN:8080,bind=127.0.0.1,reuseaddr,fork","TCP4:springboot:8080"]
|
||||
depends_on:
|
||||
springboot:
|
||||
condition: service_started
|
||||
network_mode: "service:frontend_dev"
|
||||
profiles: ["dev"]
|
||||
healthcheck:
|
||||
test: ["CMD","sh","-c","nc -z 127.0.0.1 8080"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
|
||||
loopback_8082:
|
||||
image: alpine/socat
|
||||
container_name: loopback-8082
|
||||
# 监听 127.0.0.1:8082 → 转发到 websocket-service:8082(WS 纯 TCP 可直接过)
|
||||
command: ["-d","-d","-ly","TCP4-LISTEN:8082,bind=127.0.0.1,reuseaddr,fork","TCP4:websocket-service:8082"]
|
||||
depends_on:
|
||||
websocket-service:
|
||||
condition: service_started
|
||||
network_mode: "service:frontend_dev"
|
||||
profiles: ["dev"]
|
||||
healthcheck:
|
||||
test: ["CMD","sh","-c","nc -z 127.0.0.1 8082"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
|
||||
|
||||
networks:
|
||||
openisle-network:
|
||||
driver: bridge
|
||||
|
||||
Reference in New Issue
Block a user