Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
a65c8ab
test
wayyoungboy Nov 14, 2025
7b6328a
update
wayyoungboy Nov 14, 2025
0a2e22e
1
wayyoungboy Nov 14, 2025
f210ed8
1
wayyoungboy Nov 14, 2025
85bf6dc
1
wayyoungboy Nov 14, 2025
ecc4403
1
wayyoungboy Nov 14, 2025
4ecae8f
1
wayyoungboy Nov 14, 2025
4429798
1
wayyoungboy Nov 14, 2025
a6fc072
update
wayyoungboy Nov 14, 2025
4cd798e
1
wayyoungboy Nov 14, 2025
246df7e
Merge remote-tracking branch 'github/main'
wayyoungboy Nov 14, 2025
e1590a2
update website
wayyoungboy Nov 15, 2025
c705899
Merge remote-tracking branch 'github/main'
wayyoungboy Nov 15, 2025
00ee025
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 16, 2025
ca63e9b
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 17, 2025
2997878
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 17, 2025
2818ccb
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 19, 2025
3fc72ae
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 19, 2025
aea783d
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 25, 2025
cad8200
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 27, 2025
c04cf82
Merge branch 'oceanbase:main' into main
wayyoungboy Nov 28, 2025
1a7b6e0
Merge branch 'oceanbase:main' into main
wayyoungboy Dec 4, 2025
69b1113
Merge branch 'oceanbase:main' into main
wayyoungboy Dec 17, 2025
9165bf4
Merge branch 'oceanbase:main' into main
wayyoungboy Jan 12, 2026
eb3c7c2
Merge branch 'oceanbase:main' into main
wayyoungboy Jan 19, 2026
9d61834
Feature (Docker): Manage database passwords using environment variables
wayyoungboy Jan 19, 2026
749e53e
Chore (Docker): Add custom network configuration
wayyoungboy Jan 20, 2026
726e3d5
Chore (Docker): Use lowercase seeddb names uniformly
wayyoungboy Jan 20, 2026
4e97f98
Docs (Docker): Update Docker's readme document
wayyoungboy Jan 20, 2026
e354818
Chore (Docker): Update Docker Compose configuration
wayyoungboy Jan 23, 2026
7f1f18c
Chore (Docker): Update Docker Compose configuration
wayyoungboy Jan 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 68 additions & 3 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This directory contains all Docker-related files for PowerMem Server.
## Files

- `Dockerfile` - Multi-stage Docker build file for PowerMem Server
- `docker-compose.yml` - Docker Compose configuration file
- `docker-compose.yml` - Docker Compose configuration file with seekdb support
- `docker-entrypoint.sh` - Container entrypoint script
- `.dockerignore` - Files to exclude from Docker build context
- `DOCKER.md` - Complete Docker deployment documentation
Expand All @@ -20,11 +20,19 @@ From the project root directory:
docker build -t oceanbase/powermem-server:latest -f docker/Dockerfile .
```

### Run with Docker Compose
### Run with Docker Compose (with seekdb)

From the project root directory:

```bash
# Without password (default)
docker-compose -f docker/docker-compose.yml up -d

# With password (set via command line)
SEEKDB_ROOT_PASSWORD=your_password docker-compose -f docker/docker-compose.yml up -d

# Alternatively, export the variable first
export SEEKDB_ROOT_PASSWORD=your_password
docker-compose -f docker/docker-compose.yml up -d
```

Expand All @@ -41,6 +49,58 @@ docker run -d \
oceanbase/powermem-server:latest
```

## Services

### PowerMem Server
- Port: 8000
- Health check: `http://localhost:8000/api/v1/system/health`
- Database: Connected to seekdb without password

### seekdb Database
- MySQL Port: 2881
- seekdb Web Dashboard: 2886
- Data persistence: Docker volume `seekdb_data`
- Default database: `powermem`
- Password: Controlled by `SEEKDB_ROOT_PASSWORD` environment variable
- Not set (default): No password
- Set via command line: Use specified password

## Connecting to seekdb

### Without password (default)
```bash
mysql -h 127.0.0.1 -P 2881 -u root
```

### With password (if SEEKDB_ROOT_PASSWORD is set)
```bash
mysql -h 127.0.0.1 -P 2881 -u root -p
# Enter the password when prompted
```

### seekdb Web Dashboard
Open browser to: `http://localhost:2886`
- Username: `root`
- Password: Same as `SEEKDB_ROOT_PASSWORD` environment variable (not set by default)

## Default Configuration

The `docker-compose.yml` file includes default configuration values:

**PowerMem Server:**
- Host: `0.0.0.0`
- Port: `8000`
- Workers: `4`
- Authentication: Disabled
- CORS: Enabled for all origins

**seekdb:**
- Password: Controlled by `SEEKDB_ROOT_PASSWORD` environment variable (not set by default)
- CPU: 4 cores
- Memory: 4GB
- Database: `powermem`
- Data persistence: Docker volume

## Documentation

For detailed documentation, see [DOCKER.md](./DOCKER.md).
Expand All @@ -50,4 +110,9 @@ For detailed documentation, see [DOCKER.md](./DOCKER.md).
- All Docker commands should be run from the **project root directory**, not from the `docker/` directory
- The build context is the project root, so paths in Dockerfile are relative to the project root
- The `.env` file should be in the project root directory and will be mounted into the container

- seekdb data is persisted in a Docker volume named `seekdb_data`
- On macOS with Docker version > 4.9.0, there are known issues with seekdb. Consider using an older Docker version if needed.
- **Password Management**:
- Default: No password (`SEEKDB_ROOT_PASSWORD` not set)
- To set a password: Use command line: `SEEKDB_ROOT_PASSWORD=your_password docker-compose -f docker/docker-compose.yml up -d`
- Password change: Stop services, set new password via command line, restart services
58 changes: 56 additions & 2 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
version: '3.8'

networks:
powermem-network:
driver: bridge
name: powermem-network

services:
powermem-server:
build:
Expand All @@ -22,12 +27,19 @@ services:
- POWERMEM_SERVER_CORS_ENABLED=${POWERMEM_SERVER_CORS_ENABLED:-true}
- POWERMEM_SERVER_CORS_ORIGINS=${POWERMEM_SERVER_CORS_ORIGINS:-*}
- POWERMEM_DATABASE_URL=${POWERMEM_DATABASE_URL:-}
# Database configuration for connecting to seekdb
# Use SEEKDB_ROOT_PASSWORD variable for unified password management
- DATABASE_PROVIDER=oceanbase
- OCEANBASE_HOST=seekdb
- OCEANBASE_PORT=2881
- OCEANBASE_USER=root@sys
- OCEANBASE_PASSWORD=${SEEKDB_ROOT_PASSWORD:-}
- OCEANBASE_DATABASE=powermem
- OCEANBASE_COLLECTION=memories
env_file:
- .env
volumes:
- ./logs:/app/logs
# Mount .env file so both SDK and Server can use the same configuration
- ./.env:/app/.env:ro
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.env 这一行目前还是必要的

restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/v1/system/health"]
Expand All @@ -40,4 +52,46 @@ services:
options:
max-size: "10m"
max-file: "3"
depends_on:
- seekdb
networks:
- powermem-network

seekdb:
image: oceanbase/seekdb:latest
container_name: powermem-seekdb
ports:
- "2881:2881"
- "2886:2886"
environment:
# Unified password variable for both seekdb and PowerMem Server
- ROOT_PASSWORD=${SEEKDB_ROOT_PASSWORD:-}
- CPU_COUNT=4
- MEMORY_LIMIT=4G
- LOG_DISK_SIZE=2G
- DATAFILE_SIZE=2G
- DATAFILE_NEXT=2G
- DATAFILE_MAXSIZE=50G
- SEEKDB_DATABASE=powermem
volumes:
- seekdb_data:/var/lib/oceanbase
# Mount init.sql for database initialization (optional)
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "if [ -z \"${SEEKDB_ROOT_PASSWORD}\" ]; then mysqladmin ping -h localhost -P 2881 -u root; else mysqladmin ping -h localhost -P 2881 -u root -p${SEEKDB_ROOT_PASSWORD}; fi"]
interval: 30s
timeout: 10s
retries: 5
start_period: 60s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- powermem-network

volumes:
seekdb_data:

Loading