File size: 1,821 Bytes
de36225
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

services:
  # Main Agentic Application
  agent-app:
    build: .
    container_name: text2sql-agent-app
    restart: unless-stopped
    env_file: Agent/.env
    environment:
      - OLLAMA_BASE_URL=http://172.27.224.1:11434
      - LLM_CTX=4096
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 4G
    ports:
      - "8000:8000"
      - "8700:8700"
      - "8701:8701"
    depends_on:
      employee-postgres:
        condition: service_healthy
      employee-mysql:
        condition: service_healthy
    volumes:
      - ./Agent:/app/Agent
      - ./web:/app/web
    networks:
      - employee-net

  # MySQL Database
  employee-mysql:
    image: mysql:8.0
    container_name: employee-mysql
    restart: unless-stopped
    env_file: Agent/.env
    ports:
      - "${MYSQL_PORT:-3306}:3306"
    volumes:
      - ./employee-sample-database/mysql/dataset_small:/docker-entrypoint-initdb.d
      - mysql-data:/var/lib/mysql
    networks:
      - employee-net
    healthcheck:
      test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "--silent"]
      interval: 5s
      timeout: 5s
      retries: 12
      start_period: 30s

  # PostgreSQL Database
  employee-postgres:
    image: postgres:15
    container_name: employee-postgres
    restart: unless-stopped
    env_file: Agent/.env
    ports:
      - "${POSTGRES_PORT:-5432}:5432"
    volumes:
      - ./employee-sample-database/postgres/dataset_small:/docker-entrypoint-initdb.d
      - postgres-data:/var/lib/postgresql/data
    networks:
      - employee-net
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres}"]
      interval: 5s
      timeout: 5s
      retries: 12
      start_period: 30s

volumes:
  mysql-data:
  postgres-data:

networks:
  employee-net:
    driver: bridge