Add a custom GET /mcp health route so health checks and client polling return 200 instead of flooding logs with 405. Also allow resolve_account to match by email address (from_address, imap_username, smtp_username) in addition to account ID.
28 lines
648 B
Docker
28 lines
648 B
Docker
FROM python:3.13-slim AS base
|
|
|
|
# Prevent bytecode + enable unbuffered output
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
# Install deps in a separate layer for caching
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy source
|
|
COPY src/ src/
|
|
|
|
# Non-root user
|
|
RUN adduser --disabled-password --no-create-home appuser
|
|
USER appuser
|
|
|
|
EXPOSE 3000
|
|
|
|
ENV PORT=3000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD python -c "import httpx; r = httpx.get('http://localhost:3000/mcp', timeout=5); assert r.status_code == 200" || exit 1
|
|
|
|
CMD ["python", "src/server.py"]
|