edit the docker file

هذا الالتزام موجود في:
2025-09-30 22:02:57 +03:00
الأصل b57e852c69
التزام d88d4f53d7

عرض الملف

@@ -1,34 +1,27 @@
# syntax=docker/dockerfile:1.7 # syntax=docker/dockerfile:1.7
FROM python:3.12-slim FROM python:3.12-slim
# Basic Python and Debian settings
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
UV_PROJECT_ENV=.venv \ DEBIAN_FRONTEND=noninteractive \
DEBIAN_FRONTEND=noninteractive PORT=8000
WORKDIR /app WORKDIR /app
# Install tools + uv # Install Python deps at build time only (no runtime venv or installs)
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \ # Make sure requirements.txt includes your MCP runtime/CLI (e.g., fastmcp / mcp-cli)
&& rm -rf /var/lib/apt/lists/* \ COPY requirements.txt .
&& curl -LsSf https://astral.sh/uv/install.sh | sh \ RUN pip install --no-cache-dir -r requirements.txt
&& ln -s /root/.local/bin/uv /usr/local/bin/uv
# Leverage caching for deps # Copy application source
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 . . COPY . .
# Activate venv in PATH # Expose a simple HTTP health port so ingress sees 200 immediately
ENV PATH="/app/.venv/bin:${PATH}"
# Health HTTP port for Ingress
ENV PORT=8000
EXPOSE 8000 EXPOSE 8000
# Simple HTTP health + FASTMCP over STDIO # Start a lightweight HTTP health server, then launch FASTMCP over STDIO
CMD sh -c "python -m http.server ${PORT} & exec uv run --with mcp mcp run server.py" # 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"