Docker中有两个container,一个django,一个chroma向量数据库,从Django中连接chroma报错,下面是docker-compose.yml文件: version: '3.9' services: django: container_name: django build: context: ./app command: python manage.py runserver 0.0.0.0:8000 volumes: - ./app:/Users/apple/Docker/app/ ports: - '8000:8000' expose: - 8000 chroma: container_name: chroma image: ghcr.io/chroma-core/chroma:latest volumes: - index_data:/Users/apple/Docker/app/data ports: - '8989:8989' expose: - 8989 volumes: index_data: name: my-db-data 下面是Dockerfile文件 FROM python:3.9 WORKDIR /Users/apple/Docker/app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 RUN pip install --upgrade pip COPY ./requirements.txt /Users/apple/Docker/app/requirements.txt RUN pip3 install -r requirements.txt COPY ./entrypoint.sh /Users/apple/Docker/app/entrypoint.sh COPY . /Users/apple/Docker/app/ EXPOSE 8000 ENTRYPOINT ["/Users/apple/Docker/app/entrypoint.sh"] 从Django中连接chroma向量数据看,代码如下: from rest_framework.decorators import api_view from rest_framework.response import Response import chromadb from chromadb.config import Settings chroma_client = chromadb.HttpClient( host='localhost', port=8989, settings=Settings(allow_reset=True, anonymized_telemetry=False)) @api_view(['GET']) def index(request): sample_collection = chroma_client.get_or_create_collection(name="sample_collection") print(sample_collection) return Response({ 'info': 'Hello world.' }) 报错如下: urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='127.0.0.1', port=8989): Max retries exceeded with url: /api/v1/collections (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 111] Connection refused')) Docker的容器运行情况: CONTAINER ID PORTS. NAMES 2710918946b0 0.0.0.0:8000->8000/tcp django 18ee5e4e3a7d 8000/tcp, 0.0.0.0:8989->8989/tcp chroma 请各位大佬帮忙看看,谢谢。