From 392d06023f6e9245131b0d8be32c644ab154838e Mon Sep 17 00:00:00 2001 From: admin Date: Fri, 12 Jun 2026 03:12:34 +0000 Subject: [PATCH] Add Dockerfile --- Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0b76e70 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Dockerfile for MCP Time Tools HTTP Server +# +# Usage (from directory containing this Dockerfile and mcp_time_server.py): +# +# docker build -t mcp-time-tools . +# docker run -p 8080:8080 mcp-time-tools +# +# To pass a different script at build time: +# +# docker build -t mcp-time-tools \ +# --build-arg SCRIPT=mcp_time_server.py \ +# --build-arg SCRIPT_PATH=/app/mcp_time_server.py \ +# . +# +# Or mount an external script via a build context volume or multi-stage if needed. + +FROM python:3.12-slim + +WORKDIR /app + +# Default script name and location; can be overridden via --build-arg +ARG SCRIPT=mcp_time_server.py +ARG SCRIPT_PATH=/app/mcp_time_server.py + +# Install runtime dependency for ISO 8601 duration parsing +RUN pip install --no-cache-dir python-dateutil + +# Copy the script into the container +COPY ${SCRIPT} ${SCRIPT_PATH} + +# Expose HTTP port +EXPOSE 8080 + +# Default port can be overridden at runtime with -e PORT=... +ENV PORT=8080 + +# Start the MCP time tools HTTP server +ENTRYPOINT ["python", "-u", "${SCRIPT_PATH}"]