FROM python:3.12-slim

# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Set working directory to the monorepo root to guarantee access to the local pythonSdk
WORKDIR /app

# Copy the entire monorepo into the container
COPY . /app

# Switch to the mcp-server workspace
WORKDIR /app/apps/mcp-server

# Sync the dependencies utilizing uv (this resolves the local path to modexiaagentpay)
RUN uv sync

# The MCP server runs on stdio by default. 
# If deploying to a web server (like Render Web Service) to accept remote connections, 
# you should modify server.py to use `transport='sse'` and expose the appropriate PORT.
CMD ["uv", "run", "server.py"]
