the docker file
هذا الالتزام موجود في:
35
Dockerfile
Normal file
35
Dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
FROM python:3.12-slim
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
UV_PROJECT_ENV=.venv
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install system tools + uv package manager
|
||||
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 ./
|
||||
|
||||
# Install dependencies in .venv with uv (cached layer)
|
||||
RUN --mount=type=cache,target=/root/.cache/uv \
|
||||
uv sync --frozen --no-dev
|
||||
|
||||
# Copy the rest of the source code
|
||||
COPY . .
|
||||
|
||||
# Add virtual environment to PATH
|
||||
ENV PATH="/app/.venv/bin:${PATH}"
|
||||
|
||||
# Environment variable to be set at runtime
|
||||
# ENV SERPER_API_KEY=your_key
|
||||
|
||||
# Default command to start MCP server via stdio
|
||||
CMD ["uv","run","--with","mcp","mcp","run","server.py"]
|
المرجع في مشكلة جديدة
حظر مستخدم