Kaballas commited on
Commit
40e4d8d
·
1 Parent(s): bedc715
Files changed (1) hide show
  1. Dockerfile +9 -19
Dockerfile CHANGED
@@ -2,13 +2,7 @@ FROM python:3.10-slim
2
 
3
  # Install system dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- gcc \
6
- python3-dev \
7
- openssl \
8
- curl \
9
- ca-certificates \
10
- gnupg \
11
- build-essential && \
12
  rm -rf /var/lib/apt/lists/*
13
 
14
  # Set up MariaDB's Python connector dependencies
@@ -18,11 +12,8 @@ RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
18
  ./mariadb_repo_setup --mariadb-server-version="mariadb-11.7" && \
19
  rm mariadb_repo_setup && \
20
  apt-get update && \
21
- apt-get install -y --no-install-recommends \
22
- libmariadb3 \
23
- libmariadb-dev && \
24
- apt-get clean && \
25
- rm -rf /var/lib/apt/lists/*
26
 
27
  # HF Spaces requirement: Create user with ID 1000
28
  RUN useradd -m -u 1000 user
@@ -30,18 +21,17 @@ RUN useradd -m -u 1000 user
30
  # Install uv package manager
31
  RUN pip install --no-cache-dir uv
32
 
33
- # Set working directory
34
  WORKDIR /app
35
 
36
- # HF Spaces requirement: Use /tmp for cache to avoid permission issues
37
- ENV UV_CACHE_DIR=/tmp/uvcache
38
- RUN mkdir -p ${UV_CACHE_DIR} && chmod -R 777 ${UV_CACHE_DIR}
39
 
40
  # Copy project files with proper ownership
41
  COPY --chown=user . /app
42
 
43
- # Install project dependencies and clean git cache to avoid permission issues
44
- RUN uv sync && rm -rf ${UV_CACHE_DIR}/git-v0 || true
45
 
46
  # HF Spaces requirement: Switch to user
47
  USER user
@@ -54,5 +44,5 @@ ENV HOME=/home/user \
54
  EXPOSE 7860
55
  ENV PORT=7860
56
 
57
- # Run the MCP server with SSE transport for web accessibility
58
  CMD ["sh", "-c", "uv run mcp-server-mariadb-vector --transport sse --host 0.0.0.0 --port $PORT"]
 
2
 
3
  # Install system dependencies
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ gcc python3-dev openssl curl ca-certificates gnupg build-essential && \
 
 
 
 
 
 
6
  rm -rf /var/lib/apt/lists/*
7
 
8
  # Set up MariaDB's Python connector dependencies
 
12
  ./mariadb_repo_setup --mariadb-server-version="mariadb-11.7" && \
13
  rm mariadb_repo_setup && \
14
  apt-get update && \
15
+ apt-get install -y --no-install-recommends libmariadb3 libmariadb-dev && \
16
+ apt-get clean && rm -rf /var/lib/apt/lists/*
 
 
 
17
 
18
  # HF Spaces requirement: Create user with ID 1000
19
  RUN useradd -m -u 1000 user
 
21
  # Install uv package manager
22
  RUN pip install --no-cache-dir uv
23
 
 
24
  WORKDIR /app
25
 
26
+ # CRITICAL: Disable all uv caching to prevent git permission issues
27
+ ENV UV_NO_CACHE=1
28
+ ENV UV_CACHE_DIR=/dev/null
29
 
30
  # Copy project files with proper ownership
31
  COPY --chown=user . /app
32
 
33
+ # Install project dependencies without caching
34
+ RUN uv sync --no-cache
35
 
36
  # HF Spaces requirement: Switch to user
37
  USER user
 
44
  EXPOSE 7860
45
  ENV PORT=7860
46
 
47
+ # Run the MCP server
48
  CMD ["sh", "-c", "uv run mcp-server-mariadb-vector --transport sse --host 0.0.0.0 --port $PORT"]