Closed charlesdzadu closed 1 year ago
There are several things that look off to me here. Is your code opens source? If so can you share the repo so I can help you there? If not I'll try to help here.
For the python it should be something like:
from meilisearch import Client
client = Client("http://localhost:7700")
client.create_index("medias")
For the docker compose, 3.8 is the latest version so 3.9 won't work. For meilisearch it will look something like this:
version: "3.8"
services:
meilisearch:
image: getmeili/meilisearch:latest
ports:
- "7700:7700"
volumes:
- data-ms:/data.ms
environment:
MEILI_ENV: "development"
volumes:
data-ms:
Then some suggestions for your Dockerfile
:
FROM python:3.9
WORKDIR /heliumartworks_api
RUN : \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg \
libsm6 \
libxext6 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
COPY ./requirements.txt /heliumartworks_api/requirements.txt
RUN pip install -U pip && pip --no-cache-dir -r requirements.txt
COPY ./app /heliumartworks_api/app
EXPOSE 80
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--reload"]
Hi @sanders41, thanks for your response.
Is your code opens source? If so can you share the repo so I can help you there?
Yes ! My code is open source, here is a link. Helium Artworks API All update is on dev branch, you can check it.
I update my code with your suggestions, but still get the same issue.
meilisearch.errors.MeiliSearchCommunicationError: MeiliSearchCommunicationError, HTTPConnectionPool(host='localhost', port=7700): Max retries exceeded with url: /indexes (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f1af8c6e700>: Failed to establish a new connection: [Errno 111] Connection refused'))
Thanks @charlesdzadu. I have looked at this some and since the issues isn't related to the meilisearch sdk I'm going close this issue here, and will come over to your repo to help you there.
Thanks @sanders41. I am waiting for you on my repo then.
Thank you so much @sanders41 to care of this issue ❤️ Don't hesitate if I can help 😊
Description I am a Junior Developer. I am creating an API with FastApi, Mongo, and Meilisearch. I am using docker-compose to link all my containers. This is the first time I try to integrate Meilisearch to my project so I put the configuration in my docker-compose
I try to test connection by doing this
import meilisearch client = meilisearch.Client("http://localhost:7700") client.create_index("medias")
Expected behavior I expect to not have error and create successfully this medias index.
Current behavior I have this error
Even if I run meilisearch outside of my project and try to connect I have the same issue. When I try to use Meilisearch Cloud. It works Screenshots or Logs Here is full logs
Environment (please complete the following information):
docker-compose.yml
DockerFile
**