File size: 3,999 Bytes
6979863
76f414d
 
 
6979863
 
 
 
 
 
 
 
 
 
 
 
 
bfabc2f
 
 
 
 
 
 
6979863
 
 
 
 
 
 
 
 
 
 
 
 
bfabc2f
 
 
 
 
 
 
6979863
 
76f414d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
413c3b1
 
76f414d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
977221f
 
 
 
 
 
 
 
 
 
 
76f414d
 
 
 
 
 
 
c23bac8
 
 
 
 
 
 
76f414d
 
6979863
 
 
76f414d
 
 
 
 
 
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
services:

  # ── Existing services ────────────────────────────────────────────────────────

  jupyter:
    build: .
    container_name: grapholab-jupyter
    ports:
      - "8888:8888"
    environment:
      - APP_MODE=jupyter
      - HF_HOME=/app/cache
      - JUPYTER_TOKEN=grapholab
    volumes:
      - ./notebooks:/app/notebooks
      - ./data:/app/data
      - hf_cache:/app/cache
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    restart: unless-stopped

  gradio:
    build: .
    container_name: grapholab-gradio
    ports:
      - "7860:7860"
    environment:
      - APP_MODE=gradio
      - HF_HOME=/app/cache
    volumes:
      - ./data:/app/data
      - hf_cache:/app/cache
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    restart: unless-stopped

  # ── New services (Phase 1 — professional backend) ────────────────────────────

  postgres:
    image: postgres:16-alpine
    container_name: grapholab-postgres
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: grapholab
      POSTGRES_PASSWORD: grapholab
      POSTGRES_DB: grapholab
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U grapholab"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  minio:
    image: minio/minio:latest
    container_name: grapholab-minio
    command: server /data --console-address ":9001"
    ports:
      - "9000:9000"   # S3 API
      - "9001:9001"   # Web console → http://localhost:9001
    environment:
      MINIO_ROOT_USER: grapholab
      MINIO_ROOT_PASSWORD: grapholab123
    volumes:
      - minio_data:/data
    healthcheck:
      test: ["CMD", "mc", "ready", "local"]
      interval: 10s
      timeout: 5s
      retries: 5
    restart: unless-stopped

  backend:
    build:
      context: .
      dockerfile: backend/Dockerfile
    container_name: grapholab-backend
    ports:
      - "8000:8000"   # FastAPI → http://localhost:8000/docs
    environment:
      - DATABASE_URL=postgresql+asyncpg://grapholab:grapholab@postgres:5432/grapholab
      - MINIO_ENDPOINT=minio:9000
      - MINIO_ACCESS_KEY=grapholab
      - MINIO_SECRET_KEY=grapholab123
      - MINIO_SECURE=false
      - OLLAMA_HOST=http://ollama:11434
      - SECRET_KEY=${SECRET_KEY:-change_me_in_production}
      - HF_HOME=/app/cache
      - OPENAI_API_KEY=${OPENAI_API_KEY:-}
      - SETTINGS_ENCRYPTION_KEY=${SETTINGS_ENCRYPTION_KEY:-}
    volumes:
      - ./data:/app/data
      - hf_cache:/app/cache
    depends_on:
      postgres:
        condition: service_healthy
      minio:
        condition: service_healthy
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    restart: unless-stopped

  frontend:
    build:
      context: ./frontend
      dockerfile: Dockerfile
    container_name: grapholab-frontend
    ports:
      - "3000:80"   # React SPA → http://localhost:3000
    depends_on:
      - backend
    restart: unless-stopped

  ollama:
    image: ollama/ollama:latest
    container_name: grapholab-ollama
    ports:
      - "11434:11434"
    volumes:
      - ollama_data:/root/.ollama
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]
    restart: unless-stopped

volumes:
  hf_cache:
    name: grapholab-hf-cache
  postgres_data:
    name: grapholab-postgres-data
  minio_data:
    name: grapholab-minio-data
  ollama_data:
    name: grapholab-ollama-data