Files
Memoh/devenv/docker-compose.yml
T
BBQ 04bce702b7 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.
2026-03-02 14:59:48 +08:00

159 lines
3.8 KiB
YAML

name: "memoh-dev"
services:
postgres:
image: postgres:18-alpine
container_name: memoh-dev-postgres
environment:
POSTGRES_DB: memoh
POSTGRES_USER: memoh
POSTGRES_PASSWORD: memoh123
volumes:
- postgres_data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U memoh"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
qdrant:
image: qdrant/qdrant:latest
container_name: memoh-dev-qdrant
volumes:
- qdrant_data:/qdrant/storage
ports:
- "6333:6333"
- "6334:6334"
healthcheck:
test: ["CMD-SHELL", "timeout 5s bash -c ':> /dev/tcp/127.0.0.1/6333' || exit 1"]
interval: 5s
timeout: 3s
retries: 5
restart: unless-stopped
deps:
build:
context: ..
dockerfile: devenv/Dockerfile.web
container_name: memoh-dev-deps
working_dir: /workspace
command: ["pnpm", "install"]
volumes:
- ..:/workspace
- node_modules:/workspace/node_modules
- pnpm_store:/root/.local/share/pnpm/store
restart: "no"
migrate:
build:
context: ..
dockerfile: devenv/Dockerfile.server
container_name: memoh-dev-migrate
working_dir: /workspace
entrypoint: []
command: ["go", "run", "./cmd/agent/main.go", "migrate", "up"]
environment:
CONFIG_PATH: /workspace/devenv/app.dev.toml
volumes:
- ..:/workspace
- go_mod_cache:/go/pkg/mod
- go_build_cache:/root/.cache/go-build
depends_on:
postgres:
condition: service_healthy
qdrant:
condition: service_healthy
restart: "no"
server:
build:
context: ..
dockerfile: devenv/Dockerfile.server
container_name: memoh-dev-server
working_dir: /workspace
privileged: true
pid: host
command: ["air", "-c", ".air.toml"]
environment:
CONFIG_PATH: /workspace/devenv/app.dev.toml
volumes:
- ..:/workspace
- go_mod_cache:/go/pkg/mod
- go_build_cache:/root/.cache/go-build
- containerd_data:/var/lib/containerd
- server_cni_state:/var/lib/cni
- memoh_data:/opt/memoh/data
- /etc/localtime:/etc/localtime:ro
ports:
- "8080:8080"
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://127.0.0.1:8080/health || exit 1"]
interval: 5s
timeout: 3s
retries: 20
depends_on:
migrate:
condition: service_completed_successfully
qdrant:
condition: service_healthy
restart: unless-stopped
agent:
image: oven/bun:1-alpine
container_name: memoh-dev-agent
working_dir: /workspace/agent
command: ["bun", "run", "--watch", "src/index.ts"]
volumes:
- ..:/workspace
- node_modules:/workspace/node_modules
ports:
- "8081:8081"
depends_on:
deps:
condition: service_completed_successfully
server:
condition: service_healthy
restart: unless-stopped
web:
build:
context: ..
dockerfile: devenv/Dockerfile.web
container_name: memoh-dev-web
working_dir: /workspace/packages/web
command: ["pnpm", "dev"]
volumes:
- ..:/workspace
- node_modules:/workspace/node_modules
ports:
- "8082:8082"
depends_on:
deps:
condition: service_completed_successfully
server:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
driver: local
qdrant_data:
driver: local
go_mod_cache:
driver: local
go_build_cache:
driver: local
containerd_data:
driver: local
memoh_data:
driver: local
server_cni_state:
driver: local
node_modules:
driver: local
pnpm_store:
driver: local