-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
194 lines (181 loc) · 5.69 KB
/
Copy pathdocker-compose.yml
File metadata and controls
194 lines (181 loc) · 5.69 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
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
# HERALD docker-compose
#
# All containers are prefixed `herald_` and attach to the external network
# named by HERALD_NETWORK_NAME. Each container is assigned a static IPv4 on
# that network via env vars (HERALD_*_IP) so addressing is stable across
# redeploys.
#
# Bundled databases (postgres, redis, timescaledb) live under the `bundled-db`
# profile so they only start when COMPOSE_PROFILES contains that name.
# Standalone: COMPOSE_PROFILES=bundled-db
# External DBs: COMPOSE_PROFILES= (and point *_HOST at them)
services:
# ── infrastructure (bundled) ────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
container_name: herald_postgres
profiles: ["bundled-db"]
environment:
POSTGRES_USER: ${BOOTSTRAP_PG_SUPERUSER:-postgres}
POSTGRES_PASSWORD: ${BOOTSTRAP_PG_SUPERPASS}
POSTGRES_DB: postgres
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${BOOTSTRAP_PG_SUPERUSER:-postgres}"]
interval: 10s
timeout: 5s
retries: 10
networks:
herald-net:
ipv4_address: ${HERALD_POSTGRES_IP}
restart: unless-stopped
timescaledb:
image: timescale/timescaledb:latest-pg16
container_name: herald_timescaledb
profiles: ["bundled-db"]
environment:
POSTGRES_USER: ${BOOTSTRAP_TS_SUPERUSER:-postgres}
POSTGRES_PASSWORD: ${BOOTSTRAP_TS_SUPERPASS}
POSTGRES_DB: postgres
volumes:
- timescale_data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${BOOTSTRAP_TS_SUPERUSER:-postgres}"]
interval: 10s
timeout: 5s
retries: 10
networks:
herald-net:
ipv4_address: ${HERALD_TIMESCALE_IP}
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: herald_redis
profiles: ["bundled-db"]
command: ["redis-server", "--save", "60", "1", "--loglevel", "warning"]
volumes:
- redis_data:/data
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
networks:
herald-net:
ipv4_address: ${HERALD_REDIS_IP}
restart: unless-stopped
# ── RSSHub + Browserless (third-party images) ──────────────────────────────
rsshub:
image: diygod/rsshub:latest
container_name: herald_rsshub
environment:
NODE_ENV: production
CACHE_TYPE: redis
REDIS_URL: redis://${REDIS_HOST}:${REDIS_PORT}/${REDIS_DB_RSSHUB:-1}
PUPPETEER_WS_ENDPOINT: ws://${HERALD_BROWSERLESS_IP}:3000
REQUEST_TIMEOUT: "30000"
networks:
herald-net:
ipv4_address: ${HERALD_RSSHUB_IP}
restart: unless-stopped
browserless:
image: ghcr.io/browserless/chromium:latest
container_name: herald_browserless
environment:
CONCURRENT: "5"
TIMEOUT: "30000"
TOKEN: ""
networks:
herald-net:
ipv4_address: ${HERALD_BROWSERLESS_IP}
restart: unless-stopped
# ── application services ────────────────────────────────────────────────────
feed_poller:
build:
context: .
dockerfile: services/feed_poller/Dockerfile
container_name: herald_feed_poller
env_file: .env
environment:
SOURCES_FILE: /app/sources/feeds.yaml
networks:
herald-net:
ipv4_address: ${HERALD_FEED_POLLER_IP}
restart: unless-stopped
# NOTE: the extractor is single-container here because Compose forbids
# `container_name` + `deploy.replicas`. To horizontally scale extraction,
# launch additional containers with distinct names (e.g. herald_extractor_2)
# from a sidecar compose file or `docker run`; they'll join the same Redis
# consumer group automatically via EXTRACTOR_CONSUMER_GROUP.
extractor:
build:
context: .
dockerfile: services/extractor/Dockerfile
container_name: herald_extractor
env_file: .env
networks:
herald-net:
ipv4_address: ${HERALD_EXTRACTOR_IP}
restart: unless-stopped
gdelt_ingestor:
build:
context: .
dockerfile: services/gdelt_ingestor/Dockerfile
container_name: herald_gdelt_ingestor
env_file: .env
networks:
herald-net:
ipv4_address: ${HERALD_GDELT_INGESTOR_IP}
restart: unless-stopped
maintenance:
build:
context: .
dockerfile: services/maintenance/Dockerfile
container_name: herald_maintenance
env_file: .env
networks:
herald-net:
ipv4_address: ${HERALD_MAINTENANCE_IP}
restart: unless-stopped
# ── one-off backfill (docker compose --profile backfill run --rm backfill ...) ─
backfill:
build:
context: .
dockerfile: services/backfill/Dockerfile
image: herald_backfill
container_name: herald_backfill
profiles: ["backfill"]
env_file: .env
networks:
herald-net:
ipv4_address: ${HERALD_BACKFILL_IP}
restart: "no"
mcp_server:
build:
context: .
dockerfile: services/mcp_server/Dockerfile
container_name: herald_mcp_server
env_file: .env
environment:
SOURCES_FILE: /app/sources/feeds.yaml
ports:
- "${MCP_PORT:-8000}:8000"
networks:
herald-net:
ipv4_address: ${HERALD_MCP_SERVER_IP}
restart: unless-stopped
networks:
herald-net:
external: true
name: ${HERALD_NETWORK_NAME:-herald-net}
volumes:
postgres_data:
timescale_data:
redis_data: