rcgalbo commited on
Commit
7fbb650
·
1 Parent(s): fcd08bd

Fix Dockerfile: add python3-dev and cmake/ninja pip packages

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -11
Dockerfile CHANGED
@@ -1,37 +1,38 @@
1
  # WayyDB API Docker Image for Hugging Face Spaces
2
  FROM python:3.12-slim
3
 
4
- # Install build dependencies
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
8
  ninja-build \
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"]
 
1
  # WayyDB API Docker Image for Hugging Face Spaces
2
  FROM python:3.12-slim
3
 
4
+ # Install build dependencies (including Python headers for pybind11)
5
  RUN apt-get update && apt-get install -y \
6
  build-essential \
7
  cmake \
8
  ninja-build \
9
  git \
10
+ python3-dev \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
  # Create non-root user (required by HF Spaces)
14
  RUN useradd -m -u 1000 user
15
+
16
+ # Create data directory before switching user
17
+ RUN mkdir -p /home/user/data/wayydb && chown -R user:user /home/user
18
+
19
  USER user
20
  ENV HOME=/home/user \
21
+ PATH=/home/user/.local/bin:$PATH \
22
+ WAYY_DATA_PATH=/home/user/data/wayydb \
23
+ PORT=7860
24
 
25
  WORKDIR $HOME/app
26
 
27
  # Copy source
28
  COPY --chown=user . .
29
 
30
+ # Build and install wayyDB (verbose for debugging)
31
  RUN pip install --no-cache-dir --upgrade pip && \
32
+ pip install --no-cache-dir build scikit-build-core pybind11 numpy cmake ninja && \
33
+ pip install --no-cache-dir -v . && \
34
  pip install --no-cache-dir -r api/requirements.txt
35
 
 
 
 
 
 
 
36
  EXPOSE 7860
37
 
38
  CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]