File size: 3,204 Bytes
dbb04e4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
version: '3.8'

# MnemoCore Docker Compose
# ========================
# Full stack deployment with Redis, Qdrant, and MnemoCore API

services:
  # ===========================================
  # MnemoCore API Service
  # ===========================================
  mnemocore:
    build:
      context: .
      dockerfile: Dockerfile
    image: mnemocore:latest
    container_name: mnemocore-api
    ports:
      - "8100:8100"
      - "9090:9090"  # Prometheus metrics
    volumes:
      - mnemocore_data:/app/data
      - ./config.yaml:/app/config.yaml:ro
    environment:
      - HAIM_API_KEY=${HAIM_API_KEY}
      - REDIS_URL=redis://redis:6379/0
      - QDRANT_URL=http://qdrant:6333
      - LOG_LEVEL=${LOG_LEVEL:-INFO}
      - HOST=0.0.0.0
      - PORT=8100
    env_file:
      - .env
    healthcheck:
      test: ["CMD", "python", "/app/scripts/ops/healthcheck.py"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s
    depends_on:
      redis:
        condition: service_healthy
      qdrant:
        condition: service_healthy
    networks:
      - mnemocore-network
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 2G
        reservations:
          memory: 512M

  # ===========================================
  # Redis - In-Memory Data Store
  # ===========================================
  redis:
    image: redis:7.2-alpine
    container_name: mnemocore-redis
    ports:
      - "6379:6379"
    volumes:
      - redis_data:/data
    command: >
      redis-server
      --save 60 1
      --loglevel warning
      --maxmemory 512mb
      --maxmemory-policy allkeys-lru
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s
    networks:
      - mnemocore-network
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 512M

  # ===========================================
  # Qdrant - Vector Database
  # ===========================================
  qdrant:
    image: qdrant/qdrant:latest
    container_name: mnemocore-qdrant
    ports:
      - "6333:6333"  # HTTP API
      - "6334:6334"  # gRPC API
    volumes:
      - qdrant_storage:/qdrant/storage
    environment:
      - QDRANT__SERVICE__GRPC_PORT=6334
      - QDRANT__LOG_LEVEL=INFO
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:6333/health"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 15s
    networks:
      - mnemocore-network
    restart: unless-stopped
    deploy:
      resources:
        limits:
          memory: 4G

# ===========================================
# Networks
# ===========================================
networks:
  mnemocore-network:
    driver: bridge
    name: mnemocore-net

# ===========================================
# Volumes
# ===========================================
volumes:
  mnemocore_data:
    name: mnemocore-data
  redis_data:
    name: mnemocore-redis-data
  qdrant_storage:
    name: mnemocore-qdrant-storage