docker implementation
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
.git
|
||||
.github
|
||||
.venv
|
||||
__pycache__
|
||||
.cache*
|
||||
.mypy_cache
|
||||
.pytest_cache
|
||||
.ruff_cache
|
||||
site/
|
||||
.env
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM python:3.12-slim AS builder
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.8.4 /uv /uvx /bin/
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
UV_COMPILE_BYTECODE=1 \
|
||||
UV_LINK_MODE=copy
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
COPY src ./src
|
||||
|
||||
RUN uv sync --frozen --no-dev
|
||||
|
||||
COPY docs ./docs
|
||||
COPY skills ./skills
|
||||
COPY zensical.toml ./
|
||||
|
||||
RUN uv run zensical build
|
||||
|
||||
FROM python:3.12-slim AS runtime
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PATH="/app/.venv/bin:$PATH" \
|
||||
PERSONAL_MCP_HOST=0.0.0.0 \
|
||||
PERSONAL_MCP_PORT=8765
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN groupadd --system --gid 1001 appuser \
|
||||
&& useradd --system --uid 1001 --gid appuser --create-home --home-dir /home/appuser appuser
|
||||
|
||||
COPY --from=builder --chown=appuser:appuser /app /app
|
||||
|
||||
EXPOSE 8765
|
||||
|
||||
USER appuser
|
||||
|
||||
CMD ["uvicorn", "personal_mcp.main:app", "--host", "0.0.0.0", "--port", "8765"]
|
||||
@@ -4,6 +4,28 @@ icon: lucide/rocket
|
||||
|
||||
# Get started
|
||||
|
||||
## Quick start
|
||||
|
||||
Install dependencies first:
|
||||
|
||||
```bash
|
||||
uv sync
|
||||
```
|
||||
|
||||
Run the app locally with the static docs rebuilt first:
|
||||
|
||||
```bash
|
||||
uv run zensical build && uv run uvicorn personal_mcp.main:app --host 127.0.0.1 --port 8765
|
||||
```
|
||||
|
||||
Build and run the Docker image with the same exposed port:
|
||||
|
||||
```bash
|
||||
docker build -t personal-mcp . && docker run --rm -p 8765:8765 personal-mcp
|
||||
```
|
||||
|
||||
When the server is running, the health check is available at `/healthz` and the generated docs are available at `/docs/`.
|
||||
|
||||
## Architecture
|
||||
|
||||
- [Resource-First Pattern Module Architecture](./architecture.md)
|
||||
|
||||
@@ -13,6 +13,9 @@ It also treats Markdown as the single source of truth for both MCP resources and
|
||||
```mermaid
|
||||
---
|
||||
config:
|
||||
treeView:
|
||||
rowIndent: 40
|
||||
lineThickness: 2
|
||||
themeVariables:
|
||||
treeView:
|
||||
labelColor: '#FFFFFF'
|
||||
|
||||
Reference in New Issue
Block a user