Spaces:
Paused

File size: 2,290 Bytes
5eb4857
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b7980f7
 
 
 
 
 
 
 
 
 
 
 
 
5eb4857
 
 
 
 
 
 
 
 
cc4d4a7
 
 
5eb4857
 
 
 
 
 
cc4d4a7
 
 
 
 
 
5eb4857
 
 
cc4d4a7
5eb4857
 
b7980f7
5eb4857
 
 
b7980f7
5eb4857
 
 
b7980f7
 
 
5eb4857
 
 
 
 
 
 
 
cc4d4a7
 
 
 
 
 
 
 
 
 
5eb4857
 
 
 
 
 
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
services:
  # db:
  #   image: pgvector/pgvector:pg16
  #   container_name: customer_portal_db
  #   environment:
  #     POSTGRES_USER: postgres
  #     POSTGRES_PASSWORD: postgres
  #     POSTGRES_DB: customer_portal
  #   ports:
  #     - "5432:5432"
  #   volumes:
  #     - postgres_data:/var/lib/postgresql/data
  #   restart: unless-stopped
  #   healthcheck:
  #     test: ["CMD-SHELL", "pg_isready -U postgres -d customer_portal"]
  #     interval: 10s
  #     timeout: 5s
  #     retries: 5
  #   networks:
  #     - app-network

  redis:
    image: redis:7-alpine
    container_name: nexus_search_cache
    ports:
      - "6380:6379"
    restart: unless-stopped
    healthcheck:
      test: [ "CMD", "redis-cli", "ping" ]
      interval: 5s
      timeout: 3s
      retries: 5
    networks:
      - app-network

  nexus-api:
    build:
      context: .
      target: heavy
    container_name: nexus_master_api
    env_file: .env
    extra_hosts:
      - "host.docker.internal:host-gateway"
    # depends_on:
    #   redis:
    #     condition: service_healthy
    ports:
      - "8000:8000"
    volumes:
      - .:/app
      - ./uploads:/app/uploads
      - ./logs:/app/logs
    command: [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload" ]
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
      interval: 30s
      timeout: 10s
      retries: 3
    networks:
      - app-network
    dns:
      - 1.1.1.1
      - 8.8.8.8

  nexus-worker:
    build:
      context: .
      target: heavy
    container_name: nexus_worker
    env_file: .env
    extra_hosts:
      - "host.docker.internal:host-gateway"
    # The unified worker listens to both queues (Default and Critical)
    # Queues are now configured in nexus_worker.WorkerSettings to fix CLI error
    command: ["arq", "nexus_worker.WorkerSettings"]
    volumes:
      - .:/app
    networks:
      - app-network
    dns:
      - 8.8.8.8
      - 8.8.4.4

  nexus-tunnel:
    image: cloudflare/cloudflared:latest
    container_name: nexus_tunnel
    command: tunnel --url http://nexus-api:8000
    depends_on:
      nexus-api:
        condition: service_healthy
    networks:
      - app-network

networks:
  app-network:
    driver: bridge

# volumes:
#   postgres_data: