Spaces:
Sleeping
Sleeping
Switch HF Space to Docker SDK (Streamlit SDK removed)
Browse filesCo-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- .dockerignore +19 -0
- Dockerfile +33 -0
- README.md +2 -3
.dockerignore
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Keep the Docker build context small. NOTE: data/chroma is intentionally NOT
|
| 2 |
+
# excluded β the prebuilt vector store must ship into the image.
|
| 3 |
+
.git
|
| 4 |
+
.venv
|
| 5 |
+
venv
|
| 6 |
+
ENV
|
| 7 |
+
env
|
| 8 |
+
.idea
|
| 9 |
+
.vscode
|
| 10 |
+
__pycache__
|
| 11 |
+
*.pyc
|
| 12 |
+
*.log
|
| 13 |
+
.env
|
| 14 |
+
.env.local
|
| 15 |
+
.DS_Store
|
| 16 |
+
notebooks
|
| 17 |
+
# Big inputs we don't need at runtime (the Chroma DB already holds the embeddings)
|
| 18 |
+
data/raw
|
| 19 |
+
data/processed
|
Dockerfile
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FedInsight β Streamlit RAG app on Hugging Face Spaces (Docker SDK).
|
| 2 |
+
# HF removed the managed Streamlit SDK, so we run Streamlit ourselves in Docker.
|
| 3 |
+
FROM python:3.11-slim
|
| 4 |
+
|
| 5 |
+
# Build tools for any packages without manylinux wheels (e.g. hnswlib via chromadb).
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 7 |
+
build-essential \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# Caches that must be writable at runtime. HF model downloads go to HF_HOME.
|
| 13 |
+
ENV HF_HOME=/app/.cache/huggingface \
|
| 14 |
+
XDG_CACHE_HOME=/app/.cache \
|
| 15 |
+
STREAMLIT_SERVER_PORT=7860 \
|
| 16 |
+
STREAMLIT_SERVER_ADDRESS=0.0.0.0 \
|
| 17 |
+
STREAMLIT_SERVER_HEADLESS=true \
|
| 18 |
+
STREAMLIT_BROWSER_GATHER_USAGE_STATS=false \
|
| 19 |
+
PYTHONUNBUFFERED=1
|
| 20 |
+
|
| 21 |
+
# Install deps first for better layer caching. requirements.txt pins CPU torch.
|
| 22 |
+
COPY requirements.txt .
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
+
|
| 25 |
+
# App code + the prebuilt Chroma vector store (shipped via Git LFS).
|
| 26 |
+
COPY . .
|
| 27 |
+
|
| 28 |
+
# Make app dir (incl. data/chroma and caches) writable for the runtime user.
|
| 29 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache /app/data
|
| 30 |
+
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
README.md
CHANGED
|
@@ -3,9 +3,8 @@ title: FedInsight
|
|
| 3 |
emoji: π
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
|
|
|
| 3 |
emoji: π
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: green
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
pinned: false
|
| 9 |
license: mit
|
| 10 |
---
|