39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
# 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 build with a different script (e.g. from Gitea):
|
|
#
|
|
# docker build -t mcp-time-tools \
|
|
# --build-arg SCRIPT=mcp_time_server.py \
|
|
# .
|
|
#
|
|
# The script is always copied to /app/mcp_time_server.py
|
|
# and run from there, regardless of the source filename.
|
|
|
|
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Allow overriding which file to copy (e.g. from Gitea), but always
|
|
# place it at a fixed path relative to Dockerfile root.
|
|
ARG SCRIPT=mcp_time_server.py
|
|
|
|
# Install runtime dependency for ISO 8601 duration parsing
|
|
RUN pip install --no-cache-dir python-dateutil
|
|
|
|
# Copy script into a fixed, unambiguous path
|
|
COPY ${SCRIPT} /app/mcp_time_server.py
|
|
|
|
# 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", "/app/mcp_time_server.py"]
|