Update Dockerfile

This commit is contained in:
2026-06-12 03:39:33 +00:00
parent ebf31e67d3
commit 61132a3ac6
+8 -8
View File
@@ -5,28 +5,28 @@
# docker build -t mcp-time-tools . # docker build -t mcp-time-tools .
# docker run -p 8080:8080 mcp-time-tools # docker run -p 8080:8080 mcp-time-tools
# #
# To pass a different script at build time: # To build with a different script (e.g. from Gitea):
# #
# docker build -t mcp-time-tools \ # docker build -t mcp-time-tools \
# --build-arg SCRIPT=mcp_time_server.py \ # --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. # 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 FROM python:3.12-slim
WORKDIR /app WORKDIR /app
# Default script name and location; can be overridden via --build-arg # 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 ARG SCRIPT=mcp_time_server.py
ARG SCRIPT_PATH=/app/mcp_time_server.py
# Install runtime dependency for ISO 8601 duration parsing # Install runtime dependency for ISO 8601 duration parsing
RUN pip install --no-cache-dir python-dateutil RUN pip install --no-cache-dir python-dateutil
# Copy the script into the container # Copy script into a fixed, unambiguous path
COPY ${SCRIPT} ${SCRIPT_PATH} COPY ${SCRIPT} /app/mcp_time_server.py
# Expose HTTP port # Expose HTTP port
EXPOSE 8080 EXPOSE 8080
@@ -35,4 +35,4 @@ EXPOSE 8080
ENV PORT=8080 ENV PORT=8080
# Start the MCP time tools HTTP server # Start the MCP time tools HTTP server
ENTRYPOINT ["python", "-u", "${SCRIPT_PATH}"] ENTRYPOINT ["python", "-u", "/app/mcp_time_server.py"]