Spaces:
Sleeping
Sleeping
| # Hugging Face Docker Space -> KWR EPANET MCP server over Streamable HTTP. | |
| # | |
| # This variant installs the server from PyPI (identical code to this repo's | |
| # src/, which is byte-for-byte upstream 0.2.0) instead of building local | |
| # source. That keeps the build robust even if src/ or uv.lock aren't present | |
| # in the Space's build context. The only files this image needs from the | |
| # context are app.py and the Networks/ folder. | |
| FROM python:3.11-slim | |
| # libgomp1: OpenMP runtime some numpy / EPANET-toolkit wheels expect. | |
| RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # HF Spaces convention: non-root uid 1000. | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH \ | |
| PORT=7860 \ | |
| MPLCONFIGDIR=/home/user/app/.mpl \ | |
| PYTHONUNBUFFERED=1 | |
| WORKDIR /home/user/app | |
| # Install the server + transport deps directly (no local build step, so a | |
| # missing src/ or uv.lock can't fail the build). mcp-server-epanet pulls | |
| # epyt, mcp[cli], numpy, matplotlib as dependencies. | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir "mcp-server-epanet==0.2.0" uvicorn | |
| # Copy whatever the context has (app.py, Networks/, README, ...). | |
| COPY --chown=user . . | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |