28 أسطر
905 B
Docker
28 أسطر
905 B
Docker
# syntax=docker/dockerfile:1.7
|
|
FROM python:3.12-slim
|
|
|
|
# Basic Python and Debian settings
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
PORT=8000
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Python deps at build time only (no runtime venv or installs)
|
|
# Make sure requirements.txt includes your MCP runtime/CLI (e.g., fastmcp / mcp-cli)
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy application source
|
|
COPY . .
|
|
|
|
# Expose a simple HTTP health port so ingress sees 200 immediately
|
|
EXPOSE 8000
|
|
|
|
# Start a lightweight HTTP health server, then launch FASTMCP over STDIO
|
|
# 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"
|