edit the docker file
هذا الالتزام موجود في:
35
Dockerfile
35
Dockerfile
@@ -1,34 +1,27 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Basic Python and Debian settings
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
UV_PROJECT_ENV=.venv \
|
||||
DEBIAN_FRONTEND=noninteractive
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
PORT=8000
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install tools + uv
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& curl -LsSf https://astral.sh/uv/install.sh | sh \
|
||||
&& ln -s /root/.local/bin/uv /usr/local/bin/uv
|
||||
# Install Python deps at build time only (no runtime venv or installs)
|
||||
# Make sure requirements.txt includes your MCP runtime/CLI (e.g., fastmcp / mcp-cli)
|
||||
COPY requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Leverage caching for deps
|
||||
COPY pyproject.toml uv.lock* requirements.txt* ./
|
||||
|
||||
# Install dependencies into the image (no runtime venv creation)
|
||||
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
|
||||
|
||||
# Copy source
|
||||
# Copy application source
|
||||
COPY . .
|
||||
|
||||
# Activate venv in PATH
|
||||
ENV PATH="/app/.venv/bin:${PATH}"
|
||||
|
||||
# Health HTTP port for Ingress
|
||||
ENV PORT=8000
|
||||
# Expose a simple HTTP health port so ingress sees 200 immediately
|
||||
EXPOSE 8000
|
||||
|
||||
# Simple HTTP health + FASTMCP over STDIO
|
||||
CMD sh -c "python -m http.server ${PORT} & exec uv run --with mcp mcp run server.py"
|
||||
# Start a lightweight HTTP health server, then launch FASTMCP over STDIO
|
||||
# Replace `mcp run server.py` with the correct entrypoint if different
|
||||
CMD sh -c "python -m http.server ${PORT} & exec mcp run server.py"
|
||||
# Fallback if you don't have an `mcp` CLI entry point:
|
||||
# CMD sh -c "python -m http.server ${PORT} & exec python -m mcp run server.py"
|
||||
|
المرجع في مشكلة جديدة
حظر مستخدم