felladrin / MiniSearch

Minimalist web-searching platform with an AI assistant that runs directly from your browser. Uses WebLLM, Wllama and SearXNG. Demo: https://felladrin-minisearch.hf.space
https://felladrin-minisearch.hf.space
Apache License 2.0
291 stars 29 forks source link

FR: Docker perment storage #677

Closed SurvivaLlama closed 1 month ago

SurvivaLlama commented 1 month ago

Is your feature request related to a problem? Please describe.

Please update your docker files to also include the ability to set up a storage location. That way I can manually update the setup files as needed.

Describe the solution you'd like

normal docker commanders for container path

Describe alternatives you've considered

No response

Additional context

No response

felladrin commented 1 month ago

Thanks for your suggestions, @SurvivaLlama!

What are the setup files you mentioned?

Could you point me to an example, so I can get more insights on this?

HuggingFace spaces (where the live instance runs) has some Docker restrictions, so it would need to be an opt-in feature, so it doesn't break the image deployed there. Do you think it's possible?

SurvivaLlama commented 1 month ago

Better question for you - Does the container rely on any volumes? If yes what are they so I can make them persistent?

felladrin commented 1 month ago

Ah, got it! It doesn't rely on any volumes; it doesn't store anything. The search results, for example, are fetched in real-time from a SearXNG instance running in the container, processed in memory, returned to the client, and then discarded.

SurvivaLlama commented 1 month ago

Cool. If no volumes are needed. Lets close this.

SurvivaLlama commented 1 month ago

Reopened - I was asking about this volume: /home/user/app/. does it need to be persistent?

felladrin commented 1 month ago

It doesn't.
It wouldn't help to make it persistent, as everything inside /home/user/app/ is just a copy of the repository files.
And when you run docker compose -f docker-compose.production.yml up --build, it will be compiled and run by Vite. (Vite compiles the client folder and runs an http-server with the files from the server).
But since a change in any of the /app files will trigger a new rebuild, it's safer to avoid storing the files to prevent file conflicts.

It's worth emphasizing that the root reason for the Dockerfile and the build process being like that is due to the Docker limitations of Hugging Face Spaces, where the public instance runs.

I don't know if it's a good answer for why /home/user/app/ is not inside a volume, but I understand that you're looking to optimize something in your pipeline. Could you tell me if you're using docker run -p 7860:7860 ghcr.io/felladrin/minisearch:main or docker compose -f docker-compose.production.yml up --build to run it on your side? And your concern is that it's taking time to run? Or is it due to the frequency of this repository being updated, and it takes time to update to the new image?

SurvivaLlama commented 1 month ago

Nothing like what you are asking. Its for my unRaid machine. Just looking to make sure I have the container set up correctly. If nothing needs to be persistent, then Ill keep it as is. Thanks!