diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..f33487b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +.git +.gitignore +.github +.venv +.glama-venv +.pytest_cache +__pycache__ +**/__pycache__ +*.py[cod] +.fastembed-cache +.planning +benchmarks +tests +assets/*.mp4 +docs +examples +*.log diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..65f47ed --- /dev/null +++ b/Dockerfile @@ -0,0 +1,35 @@ +# Container image for the stdio MCP server. +# +# Glama builds this to introspect the 29 tools and to offer a deployable image; +# `docker build -t turbo-quant-memory . && docker run -i --rm turbo-quant-memory` +# is the same thing by hand. The server speaks MCP over stdin/stdout, so the +# container is meant to be driven by an MCP client, not published on a port. +FROM python:3.13-slim + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + TQMEMORY_HOME=/data \ + TQMEMORY_DAEMON_DISABLE=1 \ + TQMEMORY_MIGRATE_ON_STARTUP=1 + +# onnxruntime (through fastembed) and pyarrow (through lancedb) load libgomp at +# import time; the slim image does not carry it. +RUN apt-get update \ + && apt-get install -y --no-install-recommends libgomp1 \ + && rm -rf /var/lib/apt/lists/* + +WORKDIR /app +COPY . . +RUN pip install . + +RUN useradd --create-home --uid 1000 tqmemory \ + && mkdir -p /data \ + && chown -R tqmemory:tqmemory /data +USER tqmemory + +# Memory lives in /data; mount a volume to keep it across runs. +VOLUME ["/data"] + +CMD ["turbo-memory-mcp", "serve"]