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 \
PYTHONUNBUFFERED=1 \
UV_PROJECT_ENV=.venv
ENV DEBIAN_FRONTEND=noninteractive
UV_PROJECT_ENV=.venv \
DEBIAN_FRONTEND=noninteractive
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 \
&& 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
# Copy dependency files first to leverage Docker layer caching
COPY pyproject.toml uv.lock requirements.txt ./
# Leverage caching for deps
COPY pyproject.toml uv.lock* requirements.txt* ./
# Install dependencies in .venv with uv (cached layer)
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
# Install dependencies into the image (no runtime venv creation)
RUN --mount=type=cache,target=/root/.cache/uv uv sync --frozen --no-dev
# Copy the rest of the source code
# Copy source
COPY . .
# Add virtual environment to PATH
# Activate venv in PATH
ENV PATH="/app/.venv/bin:${PATH}"
# Environment variable to be set at runtime
# ENV SERPER_API_KEY=your_key
# Health HTTP port for Ingress
ENV PORT=8000
EXPOSE 8000
# Default command to start MCP server via stdio
CMD ["uv","run","--with","mcp","mcp","run","server.py"]
# Simple HTTP health + FASTMCP over STDIO
CMD sh -c "python -m http.server ${PORT} & exec uv run --with mcp mcp run server.py"