fix: add compose hostname aliases for Podman DNS
Ensure gateway can resolve platform/ai service names after restart on production. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -37,6 +37,8 @@ services:
|
|||||||
context: ./platform
|
context: ./platform
|
||||||
args:
|
args:
|
||||||
<<: *build_args
|
<<: *build_args
|
||||||
|
# Podman DNS:显式 hostname/别名,避免 gateway lookup platform 失败
|
||||||
|
hostname: platform
|
||||||
depends_on:
|
depends_on:
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
@@ -48,12 +50,17 @@ services:
|
|||||||
- ./platform/etc/platform.docker.yaml:/app/etc/platform.yaml:ro
|
- ./platform/etc/platform.docker.yaml:/app/etc/platform.yaml:ro
|
||||||
environment:
|
environment:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
aliases:
|
||||||
|
- platform
|
||||||
|
|
||||||
ai:
|
ai:
|
||||||
build:
|
build:
|
||||||
context: ./ai-service
|
context: ./ai-service
|
||||||
args:
|
args:
|
||||||
<<: *build_args
|
<<: *build_args
|
||||||
|
hostname: ai
|
||||||
ports:
|
ports:
|
||||||
- "${AIJZ_AI_PUBLISH:-127.0.0.1:8001}:8001"
|
- "${AIJZ_AI_PUBLISH:-127.0.0.1:8001}:8001"
|
||||||
env_file:
|
env_file:
|
||||||
@@ -77,12 +84,17 @@ services:
|
|||||||
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
|
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
|
||||||
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
|
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
|
||||||
PIP_TRUSTED_HOST: pypi.tuna.tsinghua.edu.cn
|
PIP_TRUSTED_HOST: pypi.tuna.tsinghua.edu.cn
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
aliases:
|
||||||
|
- ai
|
||||||
|
|
||||||
gateway:
|
gateway:
|
||||||
build:
|
build:
|
||||||
context: ./gateway
|
context: ./gateway
|
||||||
args:
|
args:
|
||||||
<<: *build_args
|
<<: *build_args
|
||||||
|
hostname: gateway
|
||||||
depends_on:
|
depends_on:
|
||||||
- platform
|
- platform
|
||||||
- ai
|
- ai
|
||||||
@@ -93,9 +105,14 @@ services:
|
|||||||
environment:
|
environment:
|
||||||
TZ: Asia/Shanghai
|
TZ: Asia/Shanghai
|
||||||
GOPROXY: https://goproxy.cn,direct
|
GOPROXY: https://goproxy.cn,direct
|
||||||
|
networks:
|
||||||
|
default:
|
||||||
|
aliases:
|
||||||
|
- gateway
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: ${DOCKER_BASE_REGISTRY:-docker.m.daocloud.io/library}/nginx:1.27-alpine
|
image: ${DOCKER_BASE_REGISTRY:-docker.m.daocloud.io/library}/nginx:1.27-alpine
|
||||||
|
hostname: web
|
||||||
depends_on:
|
depends_on:
|
||||||
- gateway
|
- gateway
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user