diff --git a/config/config.json b/config/config.json new file mode 100644 index 0000000..a43c4c1 --- /dev/null +++ b/config/config.json @@ -0,0 +1,10 @@ +{ + "apiKey": "xyz", + "node": { + "host":"localhost", + "port":"8108", + "protocol":"http", + "path":"/", + "tls":false + } +} diff --git a/docker-compose.yml b/docker-compose.yml index 9e6dab9..4a49863 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,18 @@ services: container_name: typesense restart: on-failure ports: - - "8108:8108" + - 8107:8107 # internal status + - 8108:8108 # typesense server volumes: - ./typesense-data:/data command: '--data-dir /data --api-key=xyz --enable-cors' + typesense_dashboard: + image: ghcr.io/bfritscher/typesense-dashboard:latest + container_name: typesense_dashboard + restart: on-failure + ports: + - 8109:80 + volumes: + - ./config/config.json:/srv/config.json + depends_on: + - typesense diff --git a/guides/running_local_typesense.md b/guides/running_local_typesense.md index cb8760e..af9baca 100644 --- a/guides/running_local_typesense.md +++ b/guides/running_local_typesense.md @@ -63,3 +63,13 @@ docker compose logs -f # or specifically Typesense docker container logs --follow --tail 50 typesense ``` + +This Docker Compose setup exposes three services with dedicated URLs: + +- http://localhost:8107 (Internal Server Status), provides information about the + health and status of your internal server. +- http://localhost:8108 (Typesense Server and API), allows you to interact with + the Typesense search engine and its API functionalities. +- http://localhost:8109 (Typesense Dashboard), opens the Typesense web interface + for managing your search collections and settings. + diff --git a/test/connection_test.exs b/test/connection_test.exs index b9ce7ad..785e363 100644 --- a/test/connection_test.exs +++ b/test/connection_test.exs @@ -36,15 +36,15 @@ defmodule ConnectionTest do end end - test "error: health check, with incorrect API key" do - conn = %{api_key: "abc", host: "localhost", port: 8109, scheme: "http"} + test "error: health check, with incorrect port number" do + conn = %{api_key: "abc", host: "localhost", port: 8100, scheme: "http"} assert_raise Req.TransportError, fn -> ExTypesense.health(conn) end end - test "error: wrong API key was configured" do + test "error: wrong api key was configured" do conn = %{ host: "localhost", api_key: "another_key",