# Base Dockerfile for Portainer MCP Servers FROM python:3.11-slim # Install system dependencies RUN apt-get update && apt-get install -y \ git \ curl \ && rm -rf /var/lib/apt/lists/* # Set working directory WORKDIR /app # Copy requirements file COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # Create non-root user RUN useradd -m -u 1000 mcp && chown -R mcp:mcp /app # Switch to non-root user USER mcp # Set Python to unbuffered mode ENV PYTHONUNBUFFERED=1 # Default environment variables ENV PORTAINER_URL="" ENV PORTAINER_API_KEY="" ENV PORTAINER_INSECURE=false ENV HTTP_TIMEOUT=30 ENV MAX_RETRIES=3