-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
78 lines (67 loc) · 2.6 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
78 lines (67 loc) · 2.6 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
version: '3'
services:
nats:
image: nats:2.10.16-scratch
container_name: nats
network_mode: "host"
command: -js
restart: always
nats-box:
image: natsio/nats-box:latest
container_name: nats-box
depends_on:
- nats
network_mode: "host"
volumes:
- ../k8s/infrastructure/bases/nats/stream-config.json:/stream-config/stream-config.json
entrypoint: >
/bin/sh -c '
set -e
echo "[nats-stream-init] Waiting for NATS..."
until nc -z localhost 4222; do
sleep 1
done
# Small additional delay to ensure JetStream is ready
sleep 2
# ==================== CREATE/UPDATE STREAM ====================
echo "[nats-stream-init] Attempting to add SCANS stream..."
if nats stream add SCANS --config /stream-config/stream-config.json --server nats://localhost:4222; then
echo "[nats-stream-init] SCANS stream added successfully."
else
echo "[nats-stream-init] Add failed, attempting to edit SCANS stream..."
if nats stream edit SCANS --config /stream-config/stream-config.json --server nats://localhost:4222 --force; then
echo "[nats-stream-init] SCANS stream edited successfully."
else
echo "[nats-stream-init] ERROR: Could not add or edit SCANS stream!"
exit 1
fi
fi
# ==================== CREATE/UPDATE KV STORE ====================
echo "[nats-stream-init] Attempting to add WEB_SCANNER_IPS KV bucket..."
if nats kv add "WEB_SCANNER_IPS" \
--ttl="5m"; then
echo "[nats-stream-init] WEB_SCANNER_IPS KV bucket added successfully."
else
echo "[nats-stream-init] Add failed, attempting to edit WEB_SCANNER_IPS KV bucket..."
if nats kv edit "WEB_SCANNER_IPS" \
--ttl="5m"; then
echo "[nats-stream-init] WEB_SCANNER_IPS KV bucket edited successfully."
else
echo "[nats-stream-init] ERROR: Could not add or edit WEB_SCANNER_IPS KV bucket!"
exit 1
fi
fi
echo "[nats-stream-init] Stream initialization complete."
exec sleep infinity
'
arangodb:
image: arangodb:3.12.1
container_name: arangodb
environment:
- ARANGO_ROOT_PASSWORD=test
network_mode: "host"
restart: unless-stopped
volumes:
- ${TRACKER_BACKUP_DIR:-arangodb-data}:/var/lib/arangodb3
volumes:
arangodb-data: