Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.git
.mypy_cache
.pytest_cache
.qdrant_db
.ruff_cache
**/__pycache__/
**/*.pyc
.DS_Store

data/ml/
eval/results/
htmlcov/
.coverage

.env
.env.*
!.env.example
40 changes: 12 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,22 @@
# ClickAdvisor MCP Server
# Supports:
# Local: docker run -p 8000:8000 clickadvisor-mcp
# Railway: auto-detects PORT env var

FROM python:3.11-slim

WORKDIR /app

# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

# Install poetry
RUN pip install --no-cache-dir poetry==1.8.2

# Copy only dependency files first (layer cache)
COPY pyproject.toml poetry.lock* ./
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PORT=8000 \
MCP_PATH=/mcp \
PYTHONPATH=/app

# Install dependencies without dev extras
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --only main
COPY requirements-mcp.txt ./
RUN pip install --no-cache-dir -r requirements-mcp.txt

# Copy source
COPY clickadvisor/ ./clickadvisor/
COPY README.md ./
COPY docs/rules/cards/ ./docs/rules/cards/

# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:${PORT:-8000}/health || exit 1

# Railway / Render inject PORT automatically; fall back to 8000 locally
ENV PORT=8000
EXPOSE 8000

EXPOSE ${PORT}
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import os, socket; s=socket.create_connection(('127.0.0.1', int(os.environ.get('PORT', '8000'))), 5); s.close()"

CMD ["sh", "-c", "python -m clickadvisor.mcp_server --transport sse --host 0.0.0.0 --port ${PORT}"]
CMD ["sh", "-c", "python -c 'import os; from clickadvisor.mcp_server.server import run_http; run_http(host=\"0.0.0.0\", port=int(os.environ.get(\"PORT\", \"8000\")), path=os.environ.get(\"MCP_PATH\", \"/mcp\"))'"]
Loading
Loading