35 أسطر
919 B
Docker
35 أسطر
919 B
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
UV_PROJECT_ENV=.venv \
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
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
|
|
|
|
# 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 . .
|
|
|
|
# Activate venv in PATH
|
|
ENV PATH="/app/.venv/bin:${PATH}"
|
|
|
|
# Health HTTP port for Ingress
|
|
ENV PORT=8000
|
|
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"
|