File size: 13,835 Bytes
90c6b42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
services:
  llama-cpp:
    image: ghcr.io/ggerganov/llama.cpp:server-latest
    container_name: llama-cpp-server
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./llama-models:/models
    environment:
      - MODEL=/models/llama-3-8b-instruct.Q4_K_M.gguf
      - HOST=0.0.0.0
      - PORT=8080
      - N_CTX=4096
      - N_GPU_LAYERS=28
      - N_BATCH=512
      - N_THREADS=8
    command: --model ${MODEL} --host ${HOST} --port ${PORT} --ctx-size ${N_CTX} --n-gpu-layers ${N_GPU_LAYERS} --batch-size ${N_BATCH} --threads ${N_THREADS}
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 60s
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.llama-cpp.rule=Host(`${HOST_NAME}`) && PathPrefix(`/v1/llama`)"
      - "traefik.http.routers.llama-cpp.entrypoints=web"
      - "traefik.http.services.llama-cpp-service.loadbalancer.server.port=8080"
  traefik:
    image: "traefik:v2.10.4"
    container_name: "traefik"
    command:
      - "--log.level=ERROR"
      - "--providers.docker=true"
      - "--providers.docker.exposedByDefault=false"
      - "--entrypoints.web.address=:80"
    ports:
      - "80:80"
      - "9090:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
  postgres:
    image: postgres:13
    restart: always
    volumes:
      - ./postgres/data:/var/lib/postgresql/data
      - ./initdb.d:/docker-entrypoint-initdb.d:ro
    environment:
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secretpgpassword}
      POSTGRES_USERNAME: ${POSTGRES_USERNAME}
    healthcheck:
      test:
        ["CMD", "pg_isready", "-U", "${POSTGRES_USERNAME}", "-d", "postgres"]
      interval: 5s
      timeout: 5s
      retries: 5
    ports:
      - "5432:5432"
  supertokens:
    image: registry.supertokens.io/supertokens/supertokens-postgresql:6.0
    depends_on:
      postgres:
        condition: service_healthy
    expose:
      - 3567
    environment:
      POSTGRESQL_CONNECTION_URI: ${SUPERTOKENS_POSTGRESQL_CONNECTION_URI}
      POSTGRESQL_TABLE_NAMES_PREFIX: Supertokens
    restart: unless-stopped
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.auth.rule=Host(`${HOST_NAME}`) && PathPrefix(`/v1/auth`)"
      - "traefik.http.routers.auth.entrypoints=web"
      - "traefik.http.services.auth-service.loadbalancer.server.port=3567"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3567/hello"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
  postgraphile:
    image: graphile/postgraphile:4
    depends_on:
      postgres:
        condition: service_healthy
    restart: always
    ports:
      - "5000:5000"
    environment:
      DATABASE_URL: postgres://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD:-secretpgpassword}@postgres:5432/postgres
      PGRAPHILE_WATCH_PG: "true"
      PGRAPHILE_JWT_SECRET: ${HASURA_GRAPHQL_JWT_SECRET}
      PGRAPHILE_JWT_PG_ROLE: public
      PGRAPHILE_PG_DEFAULT_ROLE: public
      PGRAPHILE_ENABLE_GRAPHIQL: "true"
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "curl -f http://localhost:5000/graphql?query={__typename} || exit 1",
        ]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
  mongo:
    image: mongo:5.0
    container_name: mongo
    restart: unless-stopped
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/data/db
  functions:
    build: ../../frontend-nextjs/project/functions
    container_name: "functions"
    depends_on:
      - minio
      - optaplanner
      - postgres
      - postgraphile
      - mongo
    environment:
      BASIC_AUTH: ${BASIC_AUTH}
      FUNCTION_SERVER_URL: ${FUNCTION_SERVER_URL}
      OPENAI_API_KEY: ${OPENAI_API_KEY}
      GOOGLE_CLIENT_ID_ATOMIC_WEB: ${GOOGLE_CLIENT_ID_ATOMIC_WEB}
      GOOGLE_CLIENT_SECRET_ATOMIC_WEB: ${GOOGLE_CLIENT_SECRET_ATOMIC_WEB}
      HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
      POSTGRAPHILE_GRAPHQL_URL: http://postgraphile:5000/graphql
      # PYTHON_API_SERVICE_BASE_URL: ${PYTHON_API_SERVICE_BASE_URL:-http://python-agent:5000} # Removed: python-agent service deprecated
      LLAMA_CPP_URL: http://llama-cpp:8080
      DOMAIN: ${DOMAIN}
      S3_ENDPOINT: http://minio:8484
      S3_BUCKET: nhost
      S3_ACCESS_KEY: ${STORAGE_ACCESS_KEY}
      S3_SECRET_KEY: ${STORAGE_SECRET_KEY}
      HOST_IP: ${HOST_IP}
      HANDSHAKE_URL: http://${HOST_NAME}/v1/handshake
      ZOOM_PASS_KEY: ${ZOOM_PASS_KEY}
      ZOOM_CLIENT_ID: ${ZOOM_CLIENT_ID}
      ZOOM_SALT_FOR_PASS: ${ZOOM_SALT_FOR_PASS}
      ZOOM_IV_FOR_PASS: ${ZOOM_IV_FOR_PASS}
      OPTAPLANNER_URL: http://optaplanner:8081
      OPTAPLANNER_USERNAME: ${OPTAPLANNER_USERNAME}
      OPTAPLANNER_PASSWORD: ${OPTAPLANNER_PASSWORD}
      GOOGLE_AUTH_REDIRECT_URL: http://${HOST_NAME}/v1/oauth/google-calendar-handshake/oauth2callback
      APP_CLIENT_URL: ${APP_CLIENT_URL}
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.functions.rule=Host(`${HOST_NAME}`) && PathPrefix(`/v1/functions/`)"
      - "traefik.http.routers.functions.entrypoints=web"
      - "traefik.http.services.functions-service.loadbalancer.server.port=3000"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/healthz"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    restart: always
    expose:
      - 3000
    ports:
      - 3030:3030
    volumes:
      - ../../frontend-nextjs/project/functions:/app
      - functions_node_modules:/app/node_modules
      - ../../frontend-nextjs/project/functions/logs:/app/logs
  minio:
    image: minio/minio:RELEASE.2021-09-24T00-24-24Z
    entrypoint: sh
    command: -c 'mkdir -p /data/nhost && /opt/bin/minio server --console-address :9001 --address :8484 /data'
    environment:
      MINIO_ROOT_USER: ${STORAGE_ACCESS_KEY}
      MINIO_ROOT_PASSWORD: ${STORAGE_SECRET_KEY}
    ports:
      - ${MINIO_PORT:-8484}:8484
      - 9001:9001
    volumes:
      - ./data/minio:/data
  live-meeting-worker:
    build:
      context: ../python-api/live_meeting_worker
      dockerfile: Dockerfile
    container_name: live-meeting-worker
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - NOTION_API_KEY=${NOTION_API_KEY}
      - DATABASE_URL=/app/data/live_meeting_tasks.db
    volumes:
      - ./worker_data:/app/data
    ports:
      - "8001:8001"
    restart: always
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8001/list_audio_devices"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.live-meeting-worker.rule=Host(`${HOST_NAME}`) && PathPrefix(`/v1/live-meeting-worker`)"
      - "traefik.http.routers.live-meeting-worker.entrypoints=web"
      - "traefik.http.services.live-meeting-worker-service.loadbalancer.server.port=8001"
  optaplanner:
    image: atomic-scheduler:latest
    restart: always
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      QUARKUS_DATASOURCE_JDBC_URL: jdbc:postgresql://postgres:5432/postgres
      QUARKUS_DATASOURCE_USERNAME: ${POSTGRES_USERNAME}
      QUARKUS_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
      QUARKUS_DATASOURCE_DB-KIND: postgresql
      USERNAME: admin
      PASSWORD: ${API_TOKEN}
    ports:
      - 8081:8081
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8081/q/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s

  app:
    build:
      context: ../app_build_docker
      args:
        HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}

        POSTGRAPHILE_GRAPHQL_URL: http://postgraphile:5000/graphql
        NEXT_PUBLIC_POSTGRAPHILE_GRAPHQL_URL: http://localhost:5000/graphql
        NEXT_PUBLIC_EVENT_TO_QUEUE_AUTH_URL: http://${HOST_NAME}/v1/functions/schedule-event/publisherScheduleEvent/schedule-event-auth
        NEXT_PUBLIC_EVENT_TO_QUEUE_SHORT_AUTH_URL: http://${HOST_NAME}/v1/functions/schedule-event/publisherScheduleShortEvent/schedule-short-event-auth
        NEXT_PUBLIC_CALENDAR_TO_QUEUE_AUTH_URL: http://${HOST_NAME}/v1/functions/schedule-assist/publisherScheduleMeeting/schedule-meeting-to-queue-auth
        NEXT_PUBLIC_FEATURES_APPLY_TO_EVENTS_AUTH_URL: http://${HOST_NAME}/v1/functions/features-apply/publish-to-features-worker/features-worker-to-queue-auth
        NEXT_PUBLIC_METHOD_TO_SEARCH_INDEX_AUTH_URL: http://${HOST_NAME}/v1/functions/events-search/eventsSearch/events-search-auth
        NEXT_PUBLIC_GOOGLE_OAUTH_ATOMIC_WEB_API_START_URL: http://${HOST_NAME}/api/google/start-oauth
        NEXT_PUBLIC_GOOGLE_OAUTH_ATOMIC_WEB_REDIRECT_URL: http://${HOST_NAME}/api/google/oauth-callback
        GOOGLE_CLIENT_ID_ATOMIC_WEB: ${GOOGLE_CLIENT_ID_ATOMIC_WEB}
        GOOGLE_CLIENT_SECRET_ATOMIC_WEB: ${GOOGLE_CLIENT_SECRET_ATOMIC_WEB}

        NEXT_PUBLIC_DELETE_ZOOM_CONFERENCE_URL: http://${HOST_NAME}/v1/functions/zoom-meeting/delZoomMeet/delete-zoom-meet-auth
        NEXT_PUBLIC_GOOGLE_CALENDAR_SYNC_URL: http://${HOST_NAME}/v1/functions/google-calendar-sync/googleCalendarSync/google-calendar-sync-auth
        NEXT_PUBLIC_SELF_GOOGLE_CALENDAR_WATCH_URL: http://${HOST_NAME}/v1/functions/google-calendar-sync/googleCalendarWatch/google-calendar-watch-auth
        NEXT_PUBLIC_GOOGLE_OAUTH_START_URL: http://${HOST_NAME}/Auth/google/oauth-start
        NEXT_PUBLIC_CHAT_WS_API_URL: ws://localhost:3030
        NEXT_PUBLIC_GOOGLE_PEOPLE_SYNC_URL: http://${HOST_NAME}/v1/functions/google-calendar-sync/googlePeopleSync/google-contact-sync-auth
        NEXT_PUBLIC_ADD_DAILY_FEATURES_AUTOPILOT_URL: http://${HOST_NAME}/v1/functions/autopilot/addDailyFeatures/add-daily-features-to-event-auth
        NEXT_PUBLIC_DELETE_SCHEDULED_EVENT_URL: http://${HOST_NAME}/v1/functions/autopilot/deleteScheduledEvent/delete-scheduled-event-auth
        NEXT_PUBLIC_ZOOM_CREATE_MEETING_URL: http://${HOST_NAME}/v1/functions/zoom-meeting/createZoomMeet/create-zoom-meet-auth
        NEXT_PUBLIC_ZOOM_UPDATE_MEETING_URL: http://${HOST_NAME}/v1/functions/zoom-meeting/updateZoomMeet/update-zoom-meet-auth
        NEXT_PUBLIC_ZOOM_DELETE_MEETING_URL: http://${HOST_NAME}/v1/functions/zoom-meeting/delZoomMeet/delete-zoom-meet-auth
        NEXT_PUBLIC_ZOOM_OAUTH_START_URL: http://${HOST_NAME}/zoom/oauth-start
        NEXT_PUBLIC_LIVE_MEETING_WORKER_URL: http://live-meeting-worker:8001
    container_name: app
    depends_on:
      - supertokens
      - live-meeting-worker
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.app.rule=Host(`${HOST_NAME}`)"
      - "traefik.http.routers.app.entrypoints=web"
      - "traefik.http.services.app-service.loadbalancer.server.port=3000"
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 45s
    ports:
      - "3000:3000"
    environment:
      NEXT_PUBLIC_LIVE_MEETING_WORKER_URL: http://live-meeting-worker:8001
      # PYTHON_API_SERVICE_BASE_URL: ${PYTHON_API_SERVICE_BASE_URL:-http://python-agent:5000} # Removed: python-agent service deprecated
      LLAMA_CPP_URL: http://llama-cpp:8080
  # python-agent:
  # NOTE: Service removed - python_agent_build_docker directory deleted (2025-02-03)
  # Reason: Duplicate functionality exists in backend/integrations/
  # To restore, uncomment and restore python_agent_build_docker directory
  #   python-agent:
  #     build:
  #       context: ../python_agent_build_docker
  #       dockerfile: Dockerfile
  #     container_name: python-agent
  #     environment:
  #       - NOTION_API_TOKEN=${NOTION_API_TOKEN}
  #       - NOTION_NOTES_DATABASE_ID=${NOTION_NOTES_DATABASE_ID}
  #       - DEEPGRAM_API_KEY=${DEEPGRAM_API_KEY}
  #       - NOTION_RESEARCH_PROJECTS_DB_ID=${NOTION_RESEARCH_PROJECTS_DB_ID}
  #       - NOTION_RESEARCH_TASKS_DB_ID=${NOTION_RESEARCH_TASKS_DB_ID}
  #       - OPENAI_API_KEY=${OPENAI_API_KEY}
  #       - LANCEDB_URI=/lancedb_data/atom_core_db
  #       - LANCEDB_TABLE_NAME=${LANCEDB_TABLE_NAME:-meeting_transcripts_embeddings}
  #       - PYTHONUNBUFFERED=1
  #       - ENCRYPTION_KEY=${ENCRYPTION_KEY}
  #     volumes:
  #       - .:/app/project
  #       - ${LANCEDB_HOST_PATH:-./lance_db_data_shared}:/lancedb_data
  #     tty: true
  #     stdin_open: true
  ingestion-pipeline-service:
    build:
      context: ../python-api/ingestion_pipeline
      dockerfile: Dockerfile
    container_name: ingestion-pipeline-service
    restart: unless-stopped
    environment:
      - NOTION_API_KEY=${NOTION_API_KEY}
      - NOTION_TRANSCRIPTS_DATABASE_ID=${NOTION_TRANSCRIPTS_DATABASE_ID}
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - LANCEDB_URI=/lancedb_data/atom_core_db
      - ATOM_USER_ID_FOR_INGESTION=${ATOM_USER_ID_FOR_INGESTION:-default_atom_user_pipeline}
      - PROCESSING_MODE=${PROCESSING_MODE:-incremental}
      - LOG_LEVEL=${LOG_LEVEL:-INFO}
      - PYTHONUNBUFFERED=1
    volumes:
      - ${LANCEDB_HOST_PATH:-./lance_db_data_shared}:/lancedb_data
    ports:
      - "8002:8002"
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "curl -f http://localhost:8002/ingestion-status || exit 1",
        ]
      interval: 60s
      timeout: 10s
      retries: 3
      start_period: 60s
volumes:
  project_node_modules:
  functions_node_modules:
  mongo-data: {}
  llama-models: