dd
Browse files- Dockerfile +24 -9
Dockerfile
CHANGED
@@ -24,20 +24,35 @@ RUN curl -LsSO https://r.mariadb.com/downloads/mariadb_repo_setup && \
|
|
24 |
apt-get clean && \
|
25 |
rm -rf /var/lib/apt/lists/*
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
WORKDIR /app
|
28 |
|
29 |
-
#
|
30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
|
32 |
-
#
|
33 |
-
|
34 |
|
35 |
-
#
|
36 |
-
|
|
|
37 |
|
38 |
-
#
|
39 |
EXPOSE 7860
|
40 |
ENV PORT=7860
|
41 |
|
42 |
-
# Run
|
43 |
-
CMD ["
|
|
|
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
|
29 |
+
|
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
|
48 |
|
49 |
+
# HF Spaces requirement: Set user environment
|
50 |
+
ENV HOME=/home/user \
|
51 |
+
PATH=/home/user/.local/bin:$PATH
|
52 |
|
53 |
+
# HF Spaces requirement: Expose port 7860
|
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"]
|