edit the docker file

هذا الالتزام موجود في:
2025-09-30 21:23:32 +03:00
الأصل a1af40591d
التزام b57e852c69

عرض الملف

@@ -3,33 +3,32 @@ FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \ PYTHONUNBUFFERED=1 \
UV_PROJECT_ENV=.venv UV_PROJECT_ENV=.venv \
DEBIAN_FRONTEND=noninteractive
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /app WORKDIR /app
# Install system tools + uv package manager # Install tools + uv
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \ RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& curl -LsSf https://astral.sh/uv/install.sh | sh \ && curl -LsSf https://astral.sh/uv/install.sh | sh \
&& ln -s /root/.local/bin/uv /usr/local/bin/uv && ln -s /root/.local/bin/uv /usr/local/bin/uv
# Copy dependency files first to leverage Docker layer caching # Leverage caching for deps
COPY pyproject.toml uv.lock requirements.txt ./ COPY pyproject.toml uv.lock* requirements.txt* ./
# Install dependencies in .venv with uv (cached layer) # Install dependencies into the image (no runtime venv creation)
RUN --mount=type=cache,target=/root/.cache/uv \ RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
uv sync --frozen --no-dev
# Copy the rest of the source code # Copy source
COPY . . COPY . .
# Add virtual environment to PATH # Activate venv in PATH
ENV PATH="/app/.venv/bin:${PATH}" ENV PATH="/app/.venv/bin:${PATH}"
# Environment variable to be set at runtime # Health HTTP port for Ingress
# ENV SERPER_API_KEY=your_key ENV PORT=8000
EXPOSE 8000
# Default command to start MCP server via stdio # Simple HTTP health + FASTMCP over STDIO
CMD ["uv","run","--with","mcp","mcp","run","server.py"] CMD sh -c "python -m http.server ${PORT} & exec uv run --with mcp mcp run server.py"