I am using docker compose to run my server and typ...
# community-help
p
I am using docker compose to run my server and typsense side by side but for some reason my server in container is not able to connect with typesense. please can anyone help me ?
k
Did you expose port 8108 for docker?
p
actually i am kind of new to this docker ecosystem this is my compose config please check if there's any error
version: "3" services: typesense: image: typesense/typesense:0.22.2 command: "--data-dir /data --api-key=ecommerce" ports: - "8108:8108" volumes: - typesense-data:/data expose: - "8108" node-app: depends_on: - typesense build: . ports: - "8000:8000" environment: - PORT=8000 volumes: typesense-data: driver: local
k
Check if the volume directory used
typesense-data
actually exists. You can also check the container logs to see if Typesense actually starts.
p
yeah i checked typesense starts fine but my nodejs server is not able to connect to it
k
This is likely a Docker compose configuration issue. I'm not super familiar with that, so you can probably get better help on Stackoverflow.
w
The
enable-cors
flag needs to be specified so that the server can be called from a frontend?
k
Yes but it's enabled by default
p
i figured it out ! in case of docker compose you have to specify ip address of typesense service in typesense client configuration in nodejs server
👍 1