Kaballas commited on
Commit
74cc69f
·
1 Parent(s): 40e4d8d
Files changed (1) hide show
  1. Dockerfile +18 -18
Dockerfile CHANGED
@@ -5,7 +5,7 @@ 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
9
  RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
10
  echo "c4a0f3dade02c51a6a28ca3609a13d7a0f8910cccbb90935a2f218454d3a914a mariadb_repo_setup" | sha256sum -c - && \
11
  chmod +x mariadb_repo_setup && \
@@ -15,34 +15,34 @@ RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
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
20
-
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
38
 
39
- # HF Spaces requirement: Set user environment
40
  ENV HOME=/home/user \
41
- PATH=/home/user/.local/bin:$PATH
 
42
 
43
- # HF Spaces requirement: Expose port 7860
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"]
 
5
  gcc python3-dev openssl curl ca-certificates gnupg build-essential && \
6
  rm -rf /var/lib/apt/lists/*
7
 
8
+ # Set up MariaDB dependencies
9
  RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
10
  echo "c4a0f3dade02c51a6a28ca3609a13d7a0f8910cccbb90935a2f218454d3a914a mariadb_repo_setup" | sha256sum -c - && \
11
  chmod +x mariadb_repo_setup && \
 
15
  apt-get install -y --no-install-recommends libmariadb3 libmariadb-dev && \
16
  apt-get clean && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Install uv
 
 
 
19
  RUN pip install --no-cache-dir uv
20
 
21
+ # HF Spaces: Create user with ID 1000
22
+ RUN useradd -m -u 1000 user
23
 
24
+ WORKDIR /app
25
+ RUN chown -R user:user /app
 
26
 
27
  # Copy project files with proper ownership
28
  COPY --chown=user . /app
29
 
30
+ # Install dependencies globally (no virtual environment)
31
+ ENV UV_NO_CACHE=1
32
+ ENV UV_CACHE_DIR=/dev/null
33
+
34
+ # Install the package directly to system Python
35
+ RUN pip install -e .
36
 
37
+ # Switch to user
38
  USER user
39
 
40
+ # HF Spaces requirements
41
  ENV HOME=/home/user \
42
+ PATH=/home/user/.local/bin:$PATH \
43
+ PORT=7860
44
 
 
45
  EXPOSE 7860
 
46
 
47
+ # Run the package directly
48
+ CMD ["sh", "-c", "python -m mcp_server_mariadb_vector --transport sse --host 0.0.0.0 --port $PORT"]