Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,36 @@ Star memU-server to get notified about new releases and join our growing communi
```
The server runs on `http://127.0.0.1:8000`.

### Run local infrastructure with Docker Compose
Start local infrastructure dependencies (PostgreSQL and Temporal). Start the FastAPI API server separately (see "Run from source" above):

```bash
# Start infrastructure services (PostgreSQL, Temporal, Temporal UI)
docker compose up -d

# View logs
docker compose logs -f
```

**Services:**
| Service | Port | Description |
|---------|------|-------------|
| PostgreSQL | 5432 | Database with pgvector extension |
| Temporal | 7233 | Workflow engine gRPC API |
| Temporal UI | 8088 | Web management interface |

**Default Configuration:**
- PostgreSQL DSN: `postgresql://postgres:postgres@localhost:5432/memu`
- Temporal Database: `temporal` (separate from app database)

**Environment Variables (optional `.env` file):**
```env
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DB=memu
TEMPORAL_DB=temporal
```

### Run with Docker
1. Export your OpenAI API key so Docker can read it:
```bash
Expand Down
65 changes: 65 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
services:
# PostgreSQL with pgvector extension
postgres:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-memu}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
Comment thread
SparkZou marked this conversation as resolved.
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 5s
timeout: 5s
retries: 5
networks:
- memu-network

# Temporal server
# Note: Temporal shares the same PostgreSQL instance as the main app but uses
# a separate database (`TEMPORAL_DB`, default: `temporal`) from the app's
# database (`POSTGRES_DB`, default: `memu`).
# TODO: For production, consider using a separate PostgreSQL instance for Temporal
# or at minimum keep Temporal and the app in separate databases as configured here.
# Pointing both services at the same database can cause schema conflicts and is
# not recommended.
temporal:
image: temporalio/auto-setup:1.25.1
depends_on:
postgres:
condition: service_healthy
environment:
- DB=postgresql
- DB_PORT=5432
Comment thread
SparkZou marked this conversation as resolved.
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PWD=${POSTGRES_PASSWORD:-postgres}
- POSTGRES_SEEDS=postgres
- POSTGRES_DB=${TEMPORAL_DB:-temporal}
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
Comment thread
SparkZou marked this conversation as resolved.
ports:
- "7233:7233" # Temporal gRPC
networks:
- memu-network

# Temporal Web UI
temporal-ui:
image: temporalio/ui:2.31.2
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
ports:
- "8088:8080" # Temporal Web UI
networks:
Comment thread
SparkZou marked this conversation as resolved.
- memu-network

volumes:
postgres-data:
driver: local

networks:
memu-network:
driver: bridge