Update Dockerfile
This commit is contained in:
+8
-8
@@ -5,28 +5,28 @@
|
||||
# docker build -t 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 \
|
||||
# --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
|
||||
|
||||
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_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}
|
||||
# Copy script into a fixed, unambiguous path
|
||||
COPY ${SCRIPT} /app/mcp_time_server.py
|
||||
|
||||
# Expose HTTP port
|
||||
EXPOSE 8080
|
||||
@@ -35,4 +35,4 @@ EXPOSE 8080
|
||||
ENV PORT=8080
|
||||
|
||||
# Start the MCP time tools HTTP server
|
||||
ENTRYPOINT ["python", "-u", "${SCRIPT_PATH}"]
|
||||
ENTRYPOINT ["python", "-u", "/app/mcp_time_server.py"]
|
||||
|
||||
Reference in New Issue
Block a user