-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.13-slim AS base
WORKDIR /app
# System deps for building native extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Install uv for fast dependency resolution
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy project files
COPY pyproject.toml uv.lock* README.md LICENSE ./
COPY src/ src/
COPY ontology/ ontology/
COPY llms.txt ./
# Install dependencies (including embeddings for semantic search)
RUN uv sync --no-dev --frozen --extra embeddings
# Create data directory and initialize
RUN mkdir -p /data
ENV CORTEX_DATA_DIR=/data
ENV CORTEX_HOST=0.0.0.0
ENV CORTEX_PORT=1314
EXPOSE 1314
# Health check — JSON-RPC ping to MCP endpoint
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s \
CMD python -c "import urllib.request,json; r=urllib.request.Request('http://localhost:1314/mcp',data=json.dumps({'jsonrpc':'2.0','id':1,'method':'ping'}).encode(),headers={'Content-Type':'application/json','Accept':'application/json, text/event-stream'},method='POST'); urllib.request.urlopen(r)" || exit 1
# Setup (auto mode: writes .env from env vars, inits stores), then start server
CMD ["sh", "-c", "uv run cortex setup --auto && uv run cortex serve --transport mcp-http --host 0.0.0.0 --port 1314"]