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
41 changes: 27 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
FROM python:3.12-slim AS builder
# ClickAdvisor MCP Server
# Supports:
# Local: docker run -p 8000:8000 clickadvisor-mcp
# Railway: auto-detects PORT env var

WORKDIR /app
FROM python:3.11-slim

RUN pip install poetry==2.4.1
WORKDIR /app

COPY pyproject.toml poetry.lock ./
# Install system deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN poetry config virtualenvs.in-project true \
&& poetry install --no-root --without dev
# Install poetry
RUN pip install --no-cache-dir poetry==1.8.2

COPY . .
# Copy only dependency files first (layer cache)
COPY pyproject.toml poetry.lock* ./

RUN poetry install --without dev
# Install dependencies without dev extras
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi --only main

FROM python:3.12-slim
# Copy source
COPY clickadvisor/ ./clickadvisor/
COPY README.md ./

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

COPY --from=builder /app /app
# Railway / Render inject PORT automatically; fall back to 8000 locally
ENV PORT=8000

ENV PATH="/app/.venv/bin:$PATH"
EXPOSE ${PORT}

ENTRYPOINT ["chadvisor"]
CMD ["--help"]
CMD ["sh", "-c", "python -m clickadvisor.mcp_server --transport sse --host 0.0.0.0 --port ${PORT}"]
Loading
Loading