Update Dockerfile
Browse files- Dockerfile +16 -2
Dockerfile
CHANGED
|
@@ -18,11 +18,25 @@ COPY requirements.txt ./
|
|
| 18 |
# Install Python dependencies
|
| 19 |
RUN pip3 install -r requirements.txt
|
| 20 |
|
| 21 |
-
|
| 22 |
# This will copy streamlit_app.py, agents.py, the tools/ folder, etc.
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
EXPOSE 8501
|
| 27 |
|
| 28 |
# Set up a health check to see if the app is running
|
|
|
|
| 18 |
# Install Python dependencies
|
| 19 |
RUN pip3 install -r requirements.txt
|
| 20 |
|
|
|
|
| 21 |
# This will copy streamlit_app.py, agents.py, the tools/ folder, etc.
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
+
# --- START: PERMISSION FIXES FOR HUGGING FACE SPACES ---
|
| 25 |
+
|
| 26 |
+
# 1. Create the directories your application needs to write to at runtime.
|
| 27 |
+
# Using /data is a common and clean convention for persistent/writable data.
|
| 28 |
+
# The -p flag ensures parent directories are created if needed.
|
| 29 |
+
RUN mkdir -p /vectordb/lancedb
|
| 30 |
+
|
| 31 |
+
# 2. Change the ownership of these new data directories to be globally writable.
|
| 32 |
+
# The 777 permission is broad, but very effective in hosted environments where
|
| 33 |
+
# you don't know which user ID (e.g., uid=1000) will run the process.
|
| 34 |
+
# This command says "any user can read, write, and execute in these folders".
|
| 35 |
+
RUN chmod -R 777 /vectordb
|
| 36 |
+
|
| 37 |
+
# --- END: PERMISSION FIXES ---
|
| 38 |
+
|
| 39 |
+
# Expose the port Streamlit will run on. Your file uses 8501.
|
| 40 |
EXPOSE 8501
|
| 41 |
|
| 42 |
# Set up a health check to see if the app is running
|