FROM python:3.12-slim
WORKDIR /app
ENV PYTHONPATH=/app
# Install system dependencies (e.g. for psycopg2)
# psycopg2-binary usually contains headers, but libpq-dev is safer for some base images.
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq-dev gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy deps
COPY pyproject.toml .
# Copy Source
COPY src/ ./src/
# Install dependencies
# We use pip directly on pyproject.toml if compatible or standard requirements
RUN pip install --no-cache-dir .
# MCP Servers use stdin/stdout, so no port exposure needed strictly speaking
# BUT if FastMCP or others use SSE, we might need EXPOSE.
# Re-reading main.py: mcp.run() typically defaults to stdio unless configured for SSE.
# If this is for stdio usage, it's meant to be run via `docker run ...` by the MCP client.
# However, if 'deploying' implies it's a persistent service, user might want SSE?
# Assuming StdReq is 'surrounding databases', but for MCP to be consumable by a client *over network*
# it typically needs to be an SSE server.
# IMPORTANT: FastMCP defaults to stdio unless we run as SSE.
# Update main.py call later if we want network access (which .202 implies).
# For now, let's assume we run the command.
EXPOSE 8000
CMD ["python", "src/main.py"]