File size: 2,157 Bytes
aa15bce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
version: '3.8'

# Define networks for better service isolation
networks:
  app-network:
    driver: bridge

# Define volumes for persistent data
volumes:
  logs:
    driver: local

services:
  server:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - "8001:8001"
    environment:
      - OPENPOKE_HOST=0.0.0.0
      - OPENPOKE_PORT=8001
      - OPENPOKE_CORS_ALLOW_ORIGINS=*
      - OPENPOKE_ENABLE_DOCS=${OPENPOKE_ENABLE_DOCS:-1}
      # Sensitive environment variables should be loaded from .env file
      - API_BASE_URL=${API_BASE_URL}
      - API_KEY=${API_KEY}
      - COMPOSIO_API_KEY=${COMPOSIO_API_KEY}
      - INTERACTION_AGENT_MODEL=${INTERACTION_AGENT_MODEL}
      - EXECUTION_AGENT_MODEL=${EXECUTION_AGENT_MODEL}
      - EXECUTION_SEARCH_AGENT_MODEL=${EXECUTION_SEARCH_AGENT_MODEL}
      - SUMMARIZER_MODEL=${SUMMARIZER_MODEL}
      - EMAIL_CLASSIFIER_MODEL=${EMAIL_CLASSIFIER_MODEL}
    restart: unless-stopped
    networks:
      - app-network
    volumes:
      - logs:/app/logs
      - ./server:/app/server:ro
    deploy:
      resources:
        limits:
          cpus: '0.50'
          memory: 512M
        reservations:
          cpus: '0.25'
          memory: 256M
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  web:
    build:
      context: .
      dockerfile: Dockerfile.web
    ports:
      - "3000:3000"
    environment:
      - NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8001}
    depends_on:
      - server
    restart: unless-stopped
    networks:
      - app-network
    volumes:
      - ./web:/app:ro
    deploy:
      resources:
        limits:
          cpus: '0.30'
          memory: 256M
        reservations:
          cpus: '0.15'
          memory: 128M
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  # Optional: Add a reverse proxy (nginx) for production
  # nginx:
  #   image: nginx:alpine
  #   ports:
  #     - "80:80"
  #     - "443:443"
  #   volumes:
  #     - ./nginx.conf:/etc/nginx/nginx.conf
  #   depends_on:
  #     - web
  #   restart: unless-stopped