# MCP Server Dockerfile # Generated by Agent Builder Platform (template 1.1.0) # # Built on the platform's MCP server base image: Chainguard Python with the # packages in requirements.txt already installed, a non-root user (1000) and # no pip. This image adds only the server's own files. # # docker build -t : . # docker build --build-arg BASE_IMAGE= -t ... . ARG BASE_IMAGE=kyndryl.jfrog.io/kc-ai-agent-factory-docker-local/mcp-server-base:1.1.0 # Stage 1: the server's extra Python packages, if requirements.txt lists any. # The base image's build image (-build: the base image plus uv) installs # them with its vendor-install script: only the packages added go on to # /vendor, and one that would change a package the base image already has stops # the build. uv never reaches the server's image. FROM ${BASE_IMAGE}-build AS vendor COPY requirements.txt constraints.txt /tmp/ RUN vendor-install /tmp/requirements.txt /vendor /tmp/constraints.txt # Stage 2: the server: the base image, its extra packages and its files. FROM ${BASE_IMAGE} LABEL maintainer="Agent Builder Platform" LABEL description="Read-only discovery of a customer's Azure estate - servers, workloads, Kubernetes clusters, networks, data stores, policies and Advisor findings - through Azure Resource Graph." LABEL version="0.1.2" LABEL server.id="azure-discovery" LABEL template.version="1.1.0" COPY --from=vendor /vendor /app/vendor/ COPY server.py mcp_connection.py /app/ # Environment # The ConfigMap's SERVER_PORT overrides this, so the container, Service and probes agree ENV SERVER_PORT=8111 ENV LOG_LEVEL=INFO ENV LOG_FORMAT=json # Expose port EXPOSE 8111 # Health check HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ CMD python -c "import os, urllib.request; urllib.request.urlopen('http://localhost:%s/health' % (os.getenv('MCP_SERVER_PORT') or os.getenv('SERVER_PORT') or '8111'))" || exit 1 # Run the server CMD ["python", "server.py"]