Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -14
Dockerfile
CHANGED
|
@@ -1,16 +1,16 @@
|
|
| 1 |
# Hugging Face Docker Space -> KWR EPANET MCP server over Streamable HTTP.
|
| 2 |
-
#
|
| 3 |
-
#
|
| 4 |
-
#
|
|
|
|
|
|
|
|
|
|
| 5 |
FROM python:3.11-slim
|
| 6 |
|
| 7 |
# libgomp1: OpenMP runtime some numpy / EPANET-toolkit wheels expect.
|
| 8 |
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
-
# uv builds the local package (its build backend is uv_build, per pyproject).
|
| 12 |
-
RUN pip install --no-cache-dir uv
|
| 13 |
-
|
| 14 |
# HF Spaces convention: non-root uid 1000.
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
USER user
|
|
@@ -22,15 +22,14 @@ ENV HOME=/home/user \
|
|
| 22 |
|
| 23 |
WORKDIR /home/user/app
|
| 24 |
|
| 25 |
-
# Install
|
| 26 |
-
#
|
| 27 |
-
#
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
RUN uv pip install --system . uvicorn
|
| 31 |
|
| 32 |
-
#
|
| 33 |
COPY --chown=user . .
|
| 34 |
|
| 35 |
EXPOSE 7860
|
| 36 |
-
CMD ["python", "app.py"]
|
|
|
|
| 1 |
# Hugging Face Docker Space -> KWR EPANET MCP server over Streamable HTTP.
|
| 2 |
+
#
|
| 3 |
+
# This variant installs the server from PyPI (identical code to this repo's
|
| 4 |
+
# src/, which is byte-for-byte upstream 0.2.0) instead of building local
|
| 5 |
+
# source. That keeps the build robust even if src/ or uv.lock aren't present
|
| 6 |
+
# in the Space's build context. The only files this image needs from the
|
| 7 |
+
# context are app.py and the Networks/ folder.
|
| 8 |
FROM python:3.11-slim
|
| 9 |
|
| 10 |
# libgomp1: OpenMP runtime some numpy / EPANET-toolkit wheels expect.
|
| 11 |
RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
|
|
|
|
|
|
|
|
|
| 14 |
# HF Spaces convention: non-root uid 1000.
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
USER user
|
|
|
|
| 22 |
|
| 23 |
WORKDIR /home/user/app
|
| 24 |
|
| 25 |
+
# Install the server + transport deps directly (no local build step, so a
|
| 26 |
+
# missing src/ or uv.lock can't fail the build). mcp-server-epanet pulls
|
| 27 |
+
# epyt, mcp[cli], numpy, matplotlib as dependencies.
|
| 28 |
+
RUN pip install --no-cache-dir --upgrade pip \
|
| 29 |
+
&& pip install --no-cache-dir "mcp-server-epanet==0.2.0" uvicorn
|
|
|
|
| 30 |
|
| 31 |
+
# Copy whatever the context has (app.py, Networks/, README, ...).
|
| 32 |
COPY --chown=user . .
|
| 33 |
|
| 34 |
EXPOSE 7860
|
| 35 |
+
CMD ["python", "app.py"]
|