Hi, I'm having trouble running Typesense in a Dock...
# community-help
c
Hi, I'm having trouble running Typesense in a Docker container (Docker Desktop running on Windows 10). It is telling me that the data directory does not exist (even though it does), when attempting to run from a bash terminal. Any suggestions?
j
You’d need to mount the data directory from your host machine into the Docker container
Could you share the Docker run command you’re using?
c
sure thing -- I've tried this way:
Copy code
$ docker run -p 8108:8108 -v $(pwd)/typesense-data:/data typesense/typesense:0.23.1 --data-dir=/data --api-key=$TYPESENSE_API_KEY --enable-cors
I20221028 14:53:03.157213     1 typesense_server_utils.cpp:352] Starting Typesense 0.23.1
I20221028 14:53:03.157263     1 typesense_server_utils.cpp:355] Typesense is using jemalloc.
E20221028 14:53:03.157555     1 typesense_server_utils.cpp:373] Typesense failed to start. Data directory C:/Program Files/Git/data does not exist.
and this way:
Copy code
$ docker run -p 8108:8108 -v $(pwd)/typesense-data:/data typesense/typesense:0.23.1 --data-dir=$TYPESENSE_DATA_DIR --api-key=$TYPESENSE_API_KEY --enable-cors
I20221028 14:53:03.157213     1 typesense_server_utils.cpp:352] Starting Typesense 0.23.1
I20221028 14:53:03.157263     1 typesense_server_utils.cpp:355] Typesense is using jemalloc.
E20221028 14:53:03.157555     1 typesense_server_utils.cpp:373] Typesense failed to start. Data directory C:/source/typesense-data does not exist.
the data mount does not seem to be recognized correctly
j
Looks like in windows the direction of the slash might cause issues. Could you try one of the solutions here and let me know which one works for you: https://stackoverflow.com/questions/35315996/how-do-i-mount-a-docker-volume-while-using-a-windows-host I’d love to update our docs based on that
c
I was unable to get this working in Bash but was successful in Windows Powershell:`docker run -p 8108:8108 -v $PWD/typesense-data:/data typesense/typesense:0.23.1 --data-dir=/data --api-key=$TYPESENSE_API_KEY --enable-cors`
j
Oh interesting, I would have expected that to be opposite!
c
Same! Bash did not like the data volume mount for whatever reason