From ff0605ce67bb008d83ba33dba5142872cefe7e38 Mon Sep 17 00:00:00 2001
From: timothycarambat <rambat1010@gmail.com>
Date: Thu, 15 Aug 2024 16:29:56 -0700
Subject: [PATCH] Add HuggingFace deployment Dockerfile example with
 instructions

---
 .../huggingface-spaces/Dockerfile             | 31 +++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 cloud-deployments/huggingface-spaces/Dockerfile

diff --git a/cloud-deployments/huggingface-spaces/Dockerfile b/cloud-deployments/huggingface-spaces/Dockerfile
new file mode 100644
index 000000000..def87bffd
--- /dev/null
+++ b/cloud-deployments/huggingface-spaces/Dockerfile
@@ -0,0 +1,31 @@
+# With this dockerfile in a Huggingface space you will get an entire AnythingLLM instance running
+# in your space with all features you would normally get from the docker based version of AnythingLLM.
+#
+# How to use
+# - Login to https://huggingface.co/spaces
+# - Click on "Create new Space"
+# - Name the space and select "Docker" as the SDK w/ a blank template
+# - The default 2vCPU/16GB machine is OK. The more the merrier.
+# - Decide if you want your AnythingLLM Space public or private.
+#   **You might want to stay private until you at least set a password or enable multi-user mode**
+# - Click "Create Space"
+# - Click on "Settings" on top of page (https://huggingface.co/spaces/<username>/<space-name>/settings)
+# - Scroll to "Persistent Storage" and select the lowest tier of now - you can upgrade if you run out.
+# - Confirm and continue storage upgrade
+# - Go to "Files" Tab (https://huggingface.co/spaces/<username>/<space-name>/tree/main)
+# - Click "Add Files"
+# - Upload this file or create a file named `Dockerfile` and copy-paste this content into it. "Commit to main" and save.
+# - Your container will build and boot. You now have AnythingLLM on HuggingFace. Your data is stored in the persistent storage attached.
+# Have Fun 🤗 
+# Have issues? Check the logs on HuggingFace for clues.
+FROM mintplexlabs/anythingllm:render
+
+USER root
+RUN mkdir -p /data/storage
+RUN ln -s /data/storage /storage
+USER anythingllm
+
+ENV STORAGE_DIR="/data/storage"
+ENV SERVER_PORT=7860
+
+ENTRYPOINT ["/bin/bash", "/usr/local/bin/render-entrypoint.sh"]
\ No newline at end of file
-- 
GitLab