Skip to content

Commit 026450c

Browse files
committed
feat: add agentmemory docker setup
0 parents  commit 026450c

5 files changed

Lines changed: 490 additions & 0 deletions

File tree

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish image
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: ["v*"]
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
packages: write
12+
13+
env:
14+
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/agentmemory-setup
15+
16+
jobs:
17+
publish:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: docker/login-action@v3
22+
with:
23+
registry: ghcr.io
24+
username: ${{ github.actor }}
25+
password: ${{ secrets.GITHUB_TOKEN }}
26+
- uses: docker/metadata-action@v5
27+
id: meta
28+
with:
29+
images: ${{ env.IMAGE_NAME }}
30+
tags: |
31+
type=raw,value=latest,enable={{is_default_branch}}
32+
type=sha,prefix=
33+
type=ref,event=tag
34+
- uses: docker/build-push-action@v6
35+
with:
36+
context: .
37+
push: true
38+
tags: ${{ steps.meta.outputs.tags }}
39+
labels: ${{ steps.meta.outputs.labels }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.env
2+
credentials.json
3+
agentmemory-home/
4+
docker-compose.yml
5+
iii-config.docker.yaml

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:22-bookworm-slim
2+
3+
ARG AGENTMEMORY_VERSION=0.9.27
4+
5+
LABEL org.opencontainers.image.source="https://github.com/RandomCodeSpace/agentmemory-setup"
6+
LABEL org.opencontainers.image.description="AgentMemory worker for Rust iii-engine Docker setup"
7+
8+
RUN npm install -g "@agentmemory/agentmemory@${AGENTMEMORY_VERSION}" \
9+
&& npm cache clean --force \
10+
&& printf '%s\n' \
11+
'#!/bin/sh' \
12+
'set -eu' \
13+
'node -e "const base=(process.env.AGENTMEMORY_URL||\"http://127.0.0.1:3111\").replace(/\\/$/, \"\"); const wait=ms=>new Promise(r=>setTimeout(r,ms)); (async()=>{for(let i=0;i<120;i++){try{const r=await fetch(base+\"/\",{signal:AbortSignal.timeout(2000)}); if(r.status<500) process.exit(0)}catch{} await wait(1000)} console.error(\"iii-engine did not become ready at \"+base); process.exit(1)})()"' \
14+
'exec agentmemory --no-engine' \
15+
> /usr/local/bin/agentmemory-entrypoint \
16+
&& chmod +x /usr/local/bin/agentmemory-entrypoint
17+
18+
ENV NODE_ENV=production
19+
20+
CMD ["agentmemory-entrypoint"]

README.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# agentmemory-setup
2+
3+
Docker setup for AgentMemory with Rust `iii-engine` (`iiidev/iii`), OpenAI-compatible LLM config, local embeddings, persistent storage, and CPU/RAM limits.
4+
5+
## Quick Start
6+
7+
```bash
8+
./setup.sh \
9+
--base-url https://ollama.com \
10+
--api-key "$OLLAMA_API_KEY" \
11+
--model deepseek-v4-flash \
12+
--domain agent-mem.randomcodespace.dev
13+
```
14+
15+
Defaults:
16+
17+
- AgentMemory worker: `2g`, `2` CPUs
18+
- Rust iii-engine: `512m`, `1` CPU
19+
- Persistent Rust iii-engine state: `/opt/agentmemory/iii-data`
20+
- Persistent AgentMemory home: `/opt/agentmemory/agentmemory-home`
21+
- Caddy auth username: `admin`
22+
- Caddy auth password path: `/opt/agentmemory/credentials.json`
23+
24+
## Options
25+
26+
```bash
27+
./setup.sh --help
28+
```
29+
30+
Useful overrides:
31+
32+
```bash
33+
./setup.sh \
34+
--base-url https://ollama.com \
35+
--api-key "$OLLAMA_API_KEY" \
36+
--model deepseek-v4-flash \
37+
--worker-memory 2g \
38+
--engine-memory 512m \
39+
--worker-cpus 2 \
40+
--engine-cpus 1 \
41+
--data-dir /srv/agentmemory/home \
42+
--iii-data-dir /srv/agentmemory/iii
43+
```
44+
45+
## Verify
46+
47+
```bash
48+
docker compose -f /opt/agentmemory/docker-compose.yml ps
49+
curl http://127.0.0.1:3111/agentmemory/livez
50+
```
51+
52+
With Caddy:
53+
54+
```bash
55+
jq -r .password /opt/agentmemory/credentials.json
56+
```
57+
58+
Then open the configured domain and sign in as `admin`.

0 commit comments

Comments
 (0)