mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
feat(deploy): add containerd-in-docker support for docker compose
Run containerd as a sidecar container instead of requiring host containerd installation. Server mounts shared docker volumes for containerd socket, data and state.
This commit is contained in:
+35
-3
@@ -38,6 +38,30 @@ services:
|
||||
networks:
|
||||
- memoh-network
|
||||
|
||||
containerd:
|
||||
image: docker.io/library/alpine:latest
|
||||
container_name: memoh-containerd
|
||||
entrypoint: ["/bin/sh", "-c"]
|
||||
command:
|
||||
- |
|
||||
apk add --no-cache containerd containerd-ctr
|
||||
mkdir -p /run/containerd
|
||||
containerd
|
||||
privileged: true
|
||||
volumes:
|
||||
- containerd_sock:/run/containerd
|
||||
- containerd_data:/var/lib/containerd
|
||||
- memoh_data:/opt/memoh/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "test -S /run/containerd/containerd.sock"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 10
|
||||
start_period: 10s
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- memoh-network
|
||||
|
||||
server:
|
||||
build:
|
||||
context: .
|
||||
@@ -50,10 +74,10 @@ services:
|
||||
pid: host
|
||||
volumes:
|
||||
- ./config.toml:/app/config.toml:ro
|
||||
- /run/containerd/containerd.sock:/run/containerd/containerd.sock
|
||||
- /var/lib/containerd:/var/lib/containerd
|
||||
- containerd_sock:/run/containerd
|
||||
- containerd_data:/var/lib/containerd
|
||||
- server_cni_state:/var/lib/cni
|
||||
- ${MEMOH_DATA_ROOT:-~/.memoh/data}:${MEMOH_DATA_ROOT:-/opt/memoh/data}
|
||||
- memoh_data:/opt/memoh/data
|
||||
cap_add:
|
||||
- SYS_ADMIN
|
||||
- NET_ADMIN
|
||||
@@ -67,6 +91,8 @@ services:
|
||||
condition: service_healthy
|
||||
qdrant:
|
||||
condition: service_healthy
|
||||
containerd:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- memoh-network
|
||||
@@ -114,6 +140,12 @@ volumes:
|
||||
driver: local
|
||||
qdrant_data:
|
||||
driver: local
|
||||
containerd_sock:
|
||||
driver: local
|
||||
containerd_data:
|
||||
driver: local
|
||||
memoh_data:
|
||||
driver: local
|
||||
server_cni_state:
|
||||
driver: local
|
||||
|
||||
|
||||
Reference in New Issue
Block a user