# Use Python 3.11 slim image
FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY src/ ./src/
COPY main.py .
# Create non-root user
RUN useradd --create-home --shell /bin/bash mcp
RUN chown -R mcp:mcp /app
USER mcp
# Expose port for HTTP transport
EXPOSE 8000
# Default command - can be overridden
CMD ["python", "main.py", "--transport", "http", "--host", "0.0.0.0", "--port", "8000", "--google-credentials", "/app/credentials.json"]