skip to Main Content

I am trying to turn a laptop I have into a little server to host Typesense on. The computer is running Windows 11 Home. I have installed Docker and it appears to be running. I then type "docker run -d -p 8181:8181 –name my-typesense -v C:/Users/timsu/typesense-data:/data/typesense typesense/typesense:26.0" in the command prompt and press enter. The folder "typesense-data" is created by Docker, but then the container just exits. The container log line 2 says "Invalid configuration: Data directory is not specified." despite the fact that it literally just successfully created the directory for the data.

I’m sorry I don’t have any screen shots to share, there’s really nothing to share beyond what I typed above. I am absolutely happy to add some if there is something in particular any responder needs to see.

Also I know that using a laptop this way probably isn’t the best idea but I really need it for development, I don’t want to have to pay for typesense cloud just for development, but I need a good search engine in my app. Any other ideas for that?

2

Answers


  1. I think the issue could be typesense not knowing where to find the file created by Docker. Try using the -e flag to specify the environment variable for the data dir. -e TYPESENSE_DATA_DIR=your_dir/typesense-data

    Login or Signup to reply.
  2. According to the https://hub.docker.com/r/typesense/typesense and the logs for the container as following:

    # docker logs my-typesense
    Typesense 26.0
    Invalid configuration: Data directory is not specified.
    Command line usage: ./typesense-server --data-dir=string --api-key=string [options] ...
    

    you should provide –data-dir and –api-key parameters, you can try to start you container with the command like below, it should works:

    docker run -d -p 8181:8181 --name my-typesense -v C:/Users/timsu/typesense-data:/data/typesense typesense/typesense:26.0 --data-dir /data/typesense --api-key=abc 
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search