Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] Configuration example using Docker #1

Open
SalahAdDin opened this issue Sep 25, 2024 · 4 comments
Open

[FEAT] Configuration example using Docker #1

SalahAdDin opened this issue Sep 25, 2024 · 4 comments

Comments

@SalahAdDin
Copy link

Installing and configuring the plugin is easy, but we want to test it properly using Docker for Typesense.

Right now we have the following compose file:

services:

  typesense:
    image: typesense/typesense:0.24.0
    environment:
      TYPESENSE_API_KEY: typesense-api-key
      TYPESENSE_DATA_DIR: /data
    ports:
      - "8108:8108"
    volumes:
      - typesense_data:/data
    networks:
      - medusa-network

And we are setting up with the following .env variables:

TYPESENSE_NODES=/etc/typesense/nodes
TYPESENSE_API_KEY=typesense-api-key

We are not sure about this.

Could you help us?

@SalahAdDin
Copy link
Author

SalahAdDin commented Sep 25, 2024

So, we updated the compose file adding the following:

  typesense:
    image: typesense/typesense:27.0
    environment:
      TYPESENSE_API_KEY: typesense-api-key
      TYPESENSE_DATA_DIR: /data
    #ports:
    #  - "8108:8108"
    volumes:
      - typesense_data:/data
    networks:
      - medusa-network
    deploy:
      replicas: 3 # Number of Typesense nodes for high availability
      placement:
        constraints: [node.role == manager]

volumes:
  postgres_data:
  typesense_data:

networks:
  medusa-network:
    driver: bridge

And:

TYPESENSE_NODES=http://typesense-node1:8108,http://typesense-node2:8108,http://typesense-node3:8108
TYPESENSE_API_KEY=typesense-api-key

But it gives up an error in the first node:

⠹ Initializing plugins
Request #1727285157196: Request to Node 0 failed due to "ERR_BAD_REQUEST Unsupported protocol typesense-1:"
⠸ Initializing plugins
Request #1727285157196: Request to Node 0 failed due to "ERR_BAD_REQUEST Unsupported protocol typesense-1:"
✔ 

Is it normal?

@SalahAdDin
Copy link
Author

We tried adding localhost keyword after the container name since it works for the database and redis:

DATABASE_TYPE=postgres
DATABASE_URL=postgres://medusa:medusastore@localhost/medusa-tLKI

STORE_CORS=http://localhost:8000,http://localhost:7001

MEDUSA_ADMIN_ONBOARDING_TYPE=nextjs
MEDUSA_ADMIN_ONBOARDING_NEXTJS_DIRECTORY=test-storefront

OPEN_BROWSER=true

REDIS_URL=redis://localhost:6379

TYPESENSE_NODES=typesense-1://localhost:8108,typesense-2://localhost:8108,typesense-3://localhost:8108
TYPESENSE_API_KEY=typesense-api-key

Yet it does not work.

Could it be related to this issue?

@SalahAdDin
Copy link
Author

It was checked with TYPESENSE_NODES=http://typesense:8108 following the documentation's given node options.

But it does not work:

Request #1727294949320: Request to Node 0 failed due to "ENOTFOUND getaddrinfo ENOTFOUND typesense"
⠸ Initializing plugins
Request #1727294949320: Request to Node 0 failed due to "ENOTFOUND getaddrinfo ENOTFOUND typesense"

We think it is related to the Typesense.

@SalahAdDin
Copy link
Author

Finally, passing the ip itself does fix the issue: http://172.19.0.3:8108

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant