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
|
||||
args:
|
||||
<<: *build_args
|
||||
# Podman DNS:显式 hostname/别名,避免 gateway lookup platform 失败
|
||||
hostname: platform
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
@@ -48,12 +50,17 @@ services:
|
||||
- ./platform/etc/platform.docker.yaml:/app/etc/platform.yaml:ro
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
- platform
|
||||
|
||||
ai:
|
||||
build:
|
||||
context: ./ai-service
|
||||
args:
|
||||
<<: *build_args
|
||||
hostname: ai
|
||||
ports:
|
||||
- "${AIJZ_AI_PUBLISH:-127.0.0.1:8001}:8001"
|
||||
env_file:
|
||||
@@ -77,12 +84,17 @@ services:
|
||||
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
|
||||
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
|
||||
PIP_TRUSTED_HOST: pypi.tuna.tsinghua.edu.cn
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
- ai
|
||||
|
||||
gateway:
|
||||
build:
|
||||
context: ./gateway
|
||||
args:
|
||||
<<: *build_args
|
||||
hostname: gateway
|
||||
depends_on:
|
||||
- platform
|
||||
- ai
|
||||
@@ -93,9 +105,14 @@ services:
|
||||
environment:
|
||||
TZ: Asia/Shanghai
|
||||
GOPROXY: https://goproxy.cn,direct
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
- gateway
|
||||
|
||||
web:
|
||||
image: ${DOCKER_BASE_REGISTRY:-docker.m.daocloud.io/library}/nginx:1.27-alpine
|
||||
hostname: web
|
||||
depends_on:
|
||||
- gateway
|
||||
ports:
|
||||
|
||||
Reference in New Issue
Block a user