Connection_params for docker configuration

I had weaviate in the same docker-compose.yml file as my flask files and I was able to connect to it via this:

connection_params=weaviate.connect.ConnectionParams.from_params(
http_host=“weaviate”,
http_port=“8060”,
http_secure=False,
grpc_host=“weaviate”,
grpc_port=“50051”,
grpc_secure=False,
),

I just moved the weaviate instance to its own docker but still on the same machine. Now I can’t connect to it. I have tried ‘localhost’, ‘172.29.0.2’, ‘127.0.0.1’, ‘0.0.0.0’, ‘host.docker.internal’, and ‘myserver.com

What am I missing? Do I need to set up a reverse proxy now in nginx?

  • Weaviate Server Version: 1.23.9
  • Deployment Method: Docker
  • Multi Node? 1
  • Client Language and Version: Python 4.4.4

Hi! Welcome to our community :hugs:

Can you share your docker compose?

Unless you have changed the default port in the command of you Weaviate service, you should use 8080 for the connection port.

Let me know if that helps.

It’s not the port that is the problem, it’s the host, what host do I use to connect from one docker to the other on the same machine?

weaviate:
command:
- --host
- 0.0.0.0
- --port
- ‘8060’
- --scheme
- http
image: semitechnologies/weaviate:1.23.9
ports:
- 8060:8060
- 50051:50051
volumes:
- weaviate_data:/var/lib/weav
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: ‘true’
PERSISTENCE_DATA_PATH: ‘/var/lib/weav’
DEFAULT_VECTORIZER_MODULE: ‘none’
ASYNC_INDEXING: ‘true’
CLUSTER_HOSTNAME: ‘node1’

volumes:
weaviate_data

I already use like this and worked

weaviate:
    container_name: con-project-weaviate
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: semitechnologies/weaviate:1.23.10
    ports:
    - 8080:8080
    - 50051:50051
    volumes:
    - weaviate_data:/var/lib/weaviate
    restart: on-failure:0
    env_file:
      - ./python-api/.env
    environment:
      #OPENAI_APIKEY: $OPENAI_API_KEY
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'text2vec-openai'
      ENABLE_MODULES: 'text2vec-openai'
      CLUSTER_HOSTNAME: 'node1'
volumes:
  weaviate_data:

What did you use for host name in the following?

connection_params=weaviate.connect.ConnectionParams.from_params(
http_host=“weaviate”,
http_port=“8060”,
http_secure=False,
grpc_host=“weaviate”,
grpc_port=“50051”,
grpc_secure=False,
),

Hi @Dan_Gordon!

If your client is running in the same network where Weaviate is within docker, and the service name is called weaviate, this should be what you have to use.

Otherwise, if your client is running outside of docker, you should use the IP or the hostname where the ports are binded.

Let me know if this helps.

Thanks!

You must use network gateway ip from there,
@Dan_Gordon
-docker network ls
find your network for that project, then
-docker inspect network (networkaddress)
when the data network shown at the top of u can find network gateway IP
when you use that ip form the weaviatehost its works fine
it seems like that (http://172.12.0.1:8080)