feat(devenv): MCP dev hot-reload with image-based approach (#145)

Add mcp-build.sh that compiles the MCP binary and packages it as an
OCI image layer on top of the base rootfs, imported directly into
containerd. Air triggers rebuild on code changes, cleaning stale
containers automatically.

Consolidate dev-only files (Dockerfiles, entrypoint, config, build
script) into devenv/ to separate dev tooling from production artifacts.
Skip image pull when already imported to speed up dev startup.
This commit is contained in:
BBQ
2026-03-02 14:59:48 +08:00
committed by GitHub
parent f9f968f13f
commit 04bce702b7
12 changed files with 131 additions and 26 deletions
+11 -2
View File
@@ -53,7 +53,7 @@ description = "Start development environment"
run = """
#!/bin/bash
set -e
cp conf/app.dev.toml config.toml
cp devenv/app.dev.toml config.toml
docker compose -f devenv/docker-compose.yml up --build
"""
@@ -69,6 +69,15 @@ run = "docker compose -f devenv/docker-compose.yml logs -f"
description = "Restart a service (usage: mise run dev:restart -- server)"
run = "docker compose -f devenv/docker-compose.yml restart $@"
[tasks."mcp:build"]
description = "Manually build MCP dev binary (normally auto-triggered by air)"
run = """
#!/bin/bash
set -e
docker compose -f devenv/docker-compose.yml exec server \
sh -c 'cd /workspace && sh devenv/mcp-build.sh'
"""
[tasks.db-up]
description = "Initialize and Migrate Database"
run = "scripts/db-up.sh"
@@ -116,6 +125,6 @@ depends = [
run = """
#!/bin/bash
set -e
cp conf/app.dev.toml config.toml
cp devenv/app.dev.toml config.toml
echo '✓ Setup complete! Run: mise run dev'
"""