-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
107 lines (101 loc) · 2.88 KB
/
Copy pathdocker-compose.yml
File metadata and controls
107 lines (101 loc) · 2.88 KB
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
services:
db:
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: soc
POSTGRES_PASSWORD: soc
POSTGRES_DB: soc_dashboard
ports:
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
# schema is applied automatically on first init
- ./schema.sql:/docker-entrypoint-initdb.d/01-schema.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U soc -d soc_dashboard"]
interval: 5s
timeout: 5s
retries: 10
kafka:
image: apache/kafka:3.7.1
hostname: kafka
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
CLUSTER_ID: TZyCSe7oRYmCnMkoeQ6vmA
ports:
- "9092:9092"
healthcheck:
test: ["CMD-SHELL", "bash -c '</dev/tcp/localhost/9092'"]
interval: 5s
timeout: 5s
retries: 12
start_period: 15s
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
web:
build: .
environment:
DATABASE_URL: postgresql://soc:soc@db:5432/soc_dashboard
PORT: "8000"
KAFKA_BROKER: kafka:9092
REDIS_URL: redis://redis:6379
DB_ENCRYPTION_KEY: ${DB_ENCRYPTION_KEY:-}
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
kafka:
condition: service_healthy
redis:
condition: service_healthy
# Seed once the DB is ready, then launch gunicorn.
command: >
sh -c "python seed.py &&
gunicorn --bind 0.0.0.0:8000 --workers 3 app:app"
jaeger:
image: jaegertracing/all-in-one:1.57
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP HTTP receiver
environment:
COLLECTOR_OTLP_ENABLED: "true"
ingest-service:
build:
context: .
dockerfile: Dockerfile.ingest-service
environment:
DATABASE_URL: postgresql://soc:soc@db:5432/soc_dashboard
REDIS_URL: redis://redis:6379
ALERTS_API_KEY: ${ALERTS_API_KEY}
DB_ENCRYPTION_KEY: ${DB_ENCRYPTION_KEY:-}
OTEL_EXPORTER_OTLP_ENDPOINT: "jaeger:4317"
ports:
- "8001:8001"
- "9001:9001"
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
volumes:
pgdata: