Skip to content

Commit

Permalink
Merge pull request #40 from kianmeng/add-typesense-dashboard-to-docke…
Browse files Browse the repository at this point in the history
…r-compose

Add Typesense Dashboard to local Docker Compose instances
  • Loading branch information
jaeyson authored Jul 23, 2024
2 parents 1e40a95 + cc62487 commit 76c6427
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 4 deletions.
10 changes: 10 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"apiKey": "xyz",
"node": {
"host":"localhost",
"port":"8108",
"protocol":"http",
"path":"/",
"tls":false
}
}
13 changes: 12 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions guides/running_local_typesense.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

6 changes: 3 additions & 3 deletions test/connection_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 76c6427

Please sign in to comment.