# Weaviate and t2v on an aws instance

**URL:** <https://forum.weaviate.io/t/weaviate-and-t2v-on-an-aws-instance/3938>\
**Category:** Support\
**Created:** [August 31, 2024, 9:45am UTC](https://forum.weaviate.io/t/weaviate-and-t2v-on-an-aws-instance/3938 "2024-08-31T09:45:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hamza\_Rezgui](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/hamza_rezgui/32/1712_2.png) [@Hamza\_Rezgui](https://forum.weaviate.io/u/Hamza_Rezgui)\
**Post date:** [August 31, 2024, 9:45am UTC](https://forum.weaviate.io/t/weaviate-and-t2v-on-an-aws-instance/3938/1 "2024-08-31T09:45:32Z")

</div>

### Description

so i deployed my app which works fine on my local computer but when i deployed it on an aws instance using docker compose , some services aren’t really that linked to each other. I would like to know what should i change in my compose file and my code to make it work.

### Server Setup Information

```auto
  flask-app:
    image: #private docker registry here
    ports:
      - "5000:5000"
    volumes:
      - "volume-flaskapi:/usr/src/app"
    environment:
      FLASK_APP: app.py
      FLASK_ENV: development
    command: bash -c "python -m venv venv && source venv/bin/activate && pip install --no-cache-dir -r requirements.txt && flask run --host=0.0.0.0 --reload"
    depends_on:
      weaviate:
        condition: service_healthy
  weaviate:
    command:
      - --host
      - 0.0.0.0
      - --port
      - '8080'
      - --scheme
      - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.24.18
    ports:
      - 8080:8080
      - 50051:50051
    volumes:
    - weaviate_data:/var/lib/weaviate
    environment:
      TRANSFORMERS_INFERENCE_API: 'http://t2v-transformers:8080'
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'text2vec-transformers'
      ENABLE_MODULES: 'text2vec-transformers'
      CLUSTER_HOSTNAME: 'node1'
    healthcheck:
      test: ["CMD", "nc", "-z", "localhost", "8080"]
      interval: 20s
      timeout: 5s
      retries: 5
      start_period: 30s

  t2v-transformers:
    image: cr.weaviate.io/semitechnologies/transformers-inference:sentence-transformers-paraphrase-multilingual-MiniLM-L12-v2
    environment:
      ENABLE_CUDA: '0'

```

connection to weaviate in flask app  
`client = weaviate.connect_to_local(host="weaviate")`

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [September 2, 2024, 12:24pm UTC](https://forum.weaviate.io/t/weaviate-and-t2v-on-an-aws-instance/3938/2 "2024-09-02T12:24:01Z")

</div>

hi @Hamza_Rezgui !!

in your scenario, you should avoid using connect\_to\_local, and use connect\_to\_custom instead.

or if using `connect_to_local`, also provide `grpc_host ` as “weaviate”

I believe this will work for you:

```python
client = weaviate.connect_to_custom(
    http_host="weaviate",
    http_port=8080,
    http_secure=False,
    grpc_host="weaviate",
    grpc_port= 50051,
    grpc_secure=False,
)

print(client.is_ready())

```

Let me know if this helps!

THanks!
