后端: - Django + DRF - PostgreSQL 数据库 - 文件扫描服务 - 差异检查服务 - 完整 REST API 前端: - React + Ant Design - 文件树展示 - 差异对比 - API 客户端封装 部署: - Docker Compose - 后端 Dockerfile - 前端 Dockerfile - 一键启动脚本 功能: - 扫描龙虾记忆文件 - 检查文件差异 - 双向同步(本地 <-> 数据库) - 版本历史 - 统计信息
65 lines
1.4 KiB
YAML
65 lines
1.4 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL 数据库
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: lobster-postgres
|
|
environment:
|
|
POSTGRES_DB: lobster_memory
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Django 后端
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: lobster-backend
|
|
environment:
|
|
DB_HOST: postgres
|
|
DB_NAME: lobster_memory
|
|
DB_USER: postgres
|
|
DB_PASSWORD: postgres
|
|
DB_PORT: 5432
|
|
LOBSTER_MEMORY_BASE: /app/memory_files
|
|
volumes:
|
|
# 挂载龙虾记忆目录
|
|
- /home/node/.openclaw/workspace/daotong:/app/memory_files:ro
|
|
# 代码热重载(开发用)
|
|
- ./backend:/app
|
|
ports:
|
|
- "8087:8087"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
command: >
|
|
sh -c "
|
|
python manage.py migrate &&
|
|
python manage.py runserver 0.0.0.0:8087
|
|
"
|
|
|
|
# React 前端
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: lobster-frontend
|
|
ports:
|
|
- "8086:80"
|
|
environment:
|
|
- REACT_APP_API_URL=http://localhost:8087/api
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
postgres_data: |