File size: 2,755 Bytes
9930ba9
 
 
 
 
 
28e46ad
 
9930ba9
28e46ad
9930ba9
 
28e46ad
9930ba9
 
 
 
 
28e46ad
 
9930ba9
 
 
 
 
84473fd
 
28e46ad
 
9930ba9
28e46ad
84473fd
 
 
 
 
 
28e46ad
 
9930ba9
 
 
 
 
 
28e46ad
 
 
 
 
9930ba9
28e46ad
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9930ba9
795ed51
 
 
 
 
28e46ad
 
7faf776
28e46ad
 
795ed51
28e46ad
 
 
 
 
 
 
 
795ed51
75c3e99
 
 
 
 
5d556b0
75c3e99
 
28e46ad
 
 
 
 
 
 
75c3e99
f831e98
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28e46ad
 
 
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
version: '3.8'

services:
  neo4j:
    build: ./neo4j
    ports:
      - "7474:7474"
      - "7687:7687"
    environment:
      - NEO4J_AUTH=${NEO4J_AUTH}
    volumes:
      - ./neo4j/data:/data
      - ./neo4j/logs:/logs
    healthcheck:
      test: ["CMD", "cypher-shell", "-u", "neo4j", "-p", "password", "MATCH (n) RETURN count(n) LIMIT 1"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - agent-network

  postgres:
    image: postgres:15
    environment:
      - POSTGRES_DB=testdb
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    ports:
      - "5432:5432"
    volumes:
      - ./postgres/data:/var/lib/postgresql/data
      - ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - agent-network

  mcp:
    build: ./mcp
    ports:
      - "8000:8000"
    environment:
      - NEO4J_BOLT_URL=${NEO4J_BOLT_URL}
      - NEO4J_AUTH=${NEO4J_AUTH}
      - POSTGRES_CONNECTION=${POSTGRES_CONNECTION}
      - MCP_API_KEYS=${MCP_API_KEYS}
      - MCP_PORT=${MCP_PORT}
    depends_on:
      neo4j:
        condition: service_healthy
      postgres:
        condition: service_healthy
    volumes:
      - ./mcp:/app
      - ./ops/scripts:/app/ops/scripts
    command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 10s
      timeout: 5s
      retries: 5
    networks:
      - agent-network

  agent:
    build: ./agent
    environment:
      - MCP_URL=http://mcp:8000/mcp
      - MCP_API_KEY=dev-key-123
      - AGENT_POLL_INTERVAL=${AGENT_POLL_INTERVAL}
      - PAUSE_DURATION=${PAUSE_DURATION}
      - LLM_API_KEY=${LLM_API_KEY}
      - LLM_MODEL=${LLM_MODEL}
      - POSTGRES_CONNECTION=${POSTGRES_CONNECTION}
    depends_on:
      mcp:
        condition: service_healthy
    volumes:
      - ./agent:/app
    command: python -u main.py
    restart: unless-stopped
    networks:
      - agent-network

  frontend:
    build: ./frontend
    ports:
      - "3000:3000"
    environment:
      - NEXT_PUBLIC_MCP_URL=http://localhost:8000
    depends_on:
      - mcp
    volumes:
      - ./frontend:/app
      - /app/node_modules
      - /app/.next
    command: npm run dev
    networks:
      - agent-network

  streamlit:
    build: ./streamlit
    ports:
      - "8501:8501"
    environment:
      - MCP_URL=http://mcp:8000/mcp
      - MCP_API_KEY=dev-key-123
    depends_on:
      mcp:
        condition: service_healthy
    volumes:
      - ./streamlit:/app
    networks:
      - agent-network

networks:
  agent-network:
    driver: bridge