Files
2026-06-12 03:48:48 +00:00

47 lines
1.3 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.
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
# API_KEY (optional):
# - If set, requests must include:
# Authorization: Bearer <API_KEY>
# or X-API-Key: <API_KEY>
# - If not set, the server runs without auth (for dev).
# Example:
# docker run -p 8080:8080 -e API_KEY=your-secret-key mcp-time-tools
# Start the MCP time tools HTTP server
ENTRYPOINT ["python", "-u", "/app/mcp_time_server.py"]