Spaces:
Runtime error

File size: 2,632 Bytes
46085c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00033cb
 
46085c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
00033cb
 
46085c7
 
 
 
 
 
 
 
 
 
 
 
00033cb
 
46085c7
 
 
 
 
 
 
 
 
 
 
 
00033cb
 
46085c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_USER: cybully
      POSTGRES_PASSWORD: cybully
      POSTGRES_DB: cybully
    ports:
      - "5432:5432"
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U cybully -d cybully"]
      interval: 10s
      timeout: 5s
      retries: 5

  rabbitmq:
    image: rabbitmq:3.13-management
    environment:
      RABBITMQ_DEFAULT_USER: cybully
      RABBITMQ_DEFAULT_PASS: cybully
    ports:
      - "5672:5672"
      - "15672:15672"
    healthcheck:
      test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  api:
    build:
      context: ./services/api
    env_file: .env
    environment:
      DATABASE_URL: postgresql+asyncpg://cybully:cybully@postgres:5432/cybully
      RABBITMQ_URL: amqp://cybully:cybully@rabbitmq:5672/
      PIPELINE_MODE: queue
      SCORER_PROVIDER: detoxify
    command: sh -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 8000"
    ports:
      - "8000:8000"
    depends_on:
      postgres:
        condition: service_healthy
      rabbitmq:
        condition: service_healthy

  inference-worker:
    build:
      context: ./services/api
    env_file: .env
    environment:
      DATABASE_URL: postgresql+asyncpg://cybully:cybully@postgres:5432/cybully
      RABBITMQ_URL: amqp://cybully:cybully@rabbitmq:5672/
      PIPELINE_MODE: queue
      SCORER_PROVIDER: detoxify
    command: python -m app.workers.inference
    depends_on:
      api:
        condition: service_started

  persistence-worker:
    build:
      context: ./services/api
    env_file: .env
    environment:
      DATABASE_URL: postgresql+asyncpg://cybully:cybully@postgres:5432/cybully
      RABBITMQ_URL: amqp://cybully:cybully@rabbitmq:5672/
      PIPELINE_MODE: queue
      SCORER_PROVIDER: detoxify
    command: python -m app.workers.persistence
    depends_on:
      api:
        condition: service_started

  alert-worker:
    build:
      context: ./services/api
    env_file: .env
    environment:
      DATABASE_URL: postgresql+asyncpg://cybully:cybully@postgres:5432/cybully
      RABBITMQ_URL: amqp://cybully:cybully@rabbitmq:5672/
      PIPELINE_MODE: queue
      SCORER_PROVIDER: detoxify
    command: python -m app.workers.alerts
    depends_on:
      api:
        condition: service_started

  web:
    build:
      context: ./apps/web
    env_file: .env
    environment:
      API_BASE_URL: http://api:8000
    ports:
      - "3000:3000"
    depends_on:
      - api

volumes:
  postgres_data: