rcgalbo Claude Opus 4.5 commited on
Commit
fcd08bd
·
1 Parent(s): be7c937

Add Hugging Face Spaces deployment

Browse files

- Add FastAPI REST API wrapper (api/main.py)
- Configure Dockerfile for HF Spaces (non-root user, port 7860)
- Add HF Spaces metadata to README.md
- Support concurrent operations via thread pool

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Files changed (2) hide show
  1. Dockerfile +18 -12
  2. README.md +9 -0
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # WayyDB API Docker Image
2
  FROM python:3.12-slim
3
 
4
  # Install build dependencies
@@ -9,23 +9,29 @@ RUN apt-get update && apt-get install -y \
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- WORKDIR /app
 
 
 
 
 
 
13
 
14
  # Copy source
15
- COPY . .
16
 
17
  # Build and install wayyDB
18
- RUN pip install --upgrade pip && \
19
- pip install build scikit-build-core pybind11 numpy && \
20
- pip install . && \
21
- pip install -r api/requirements.txt
22
 
23
  # Create data directory
24
- RUN mkdir -p /data/wayydb
25
 
26
- ENV WAYY_DATA_PATH=/data/wayydb
27
- ENV PORT=8000
28
 
29
- EXPOSE 8000
30
 
31
- CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
 
1
+ # WayyDB API Docker Image for Hugging Face Spaces
2
  FROM python:3.12-slim
3
 
4
  # Install build dependencies
 
9
  git \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Create non-root user (required by HF Spaces)
13
+ RUN useradd -m -u 1000 user
14
+ USER user
15
+ ENV HOME=/home/user \
16
+ PATH=/home/user/.local/bin:$PATH
17
+
18
+ WORKDIR $HOME/app
19
 
20
  # Copy source
21
+ COPY --chown=user . .
22
 
23
  # Build and install wayyDB
24
+ RUN pip install --no-cache-dir --upgrade pip && \
25
+ pip install --no-cache-dir build scikit-build-core pybind11 numpy && \
26
+ pip install --no-cache-dir . && \
27
+ pip install --no-cache-dir -r api/requirements.txt
28
 
29
  # Create data directory
30
+ RUN mkdir -p $HOME/data/wayydb
31
 
32
+ ENV WAYY_DATA_PATH=$HOME/data/wayydb
33
+ ENV PORT=7860
34
 
35
+ EXPOSE 7860
36
 
37
+ CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  <p align="center">
2
  <h1 align="center">WayyDB</h1>
3
  <p align="center">
 
1
+ ---
2
+ title: WayyDB API
3
+ emoji: ⚡
4
+ colorFrom: blue
5
+ colorTo: purple
6
+ sdk: docker
7
+ app_port: 7860
8
+ ---
9
+
10
  <p align="center">
11
  <h1 align="center">WayyDB</h1>
12
  <p align="center">