-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
333 lines (316 loc) · 10.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
333 lines (316 loc) · 10.7 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
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# =============================================================================
# JobHunter (Arachnode) — Production Docker Compose
# =============================================================================
#
# REQUIRED ENVIRONMENT VARIABLES — copy .env.example to .env before running:
#
# JOBHUNTER_API_KEY API key for dashboard authentication (set a strong random string)
# POSTGRES_USER Database user (default: jobuser)
# POSTGRES_PASSWORD Database password (default: jobpass)
# POSTGRES_DB Database name (default: jobsdb)
# GITHUB_TOKEN GitHub personal access token for contact discovery
# GMAIL_ADDRESS Gmail address for sending cold emails
# GMAIL_APP_PASSWORD Gmail App Password (NOT your account password)
# YOUR_NAME Your display name for cold email templates
# YOUR_GITHUB_URL Your GitHub profile URL
# JOBSEEKER_ROLE Target job title (default: Backend Engineer)
# JOBSEEKER_STACK Comma-separated tech stack (default: Python,FastAPI,PostgreSQL,Redis,Go)
# OLLAMA_BASE_URL Ollama endpoint for LLM (default: http://host.docker.internal:11434)
# GATEWAY_PORT Host port for the dashboard (default: 8080)
#
# QUICK START:
# cp .env.example .env # then edit with your values
# docker compose up -d
# open http://localhost:8080
#
# Postgres and Redis are intentionally NOT exposed to the host.
# Use docker exec for direct access during development:
# docker exec -it $(docker compose ps -q postgres) psql -U jobuser jobsdb
# docker exec -it $(docker compose ps -q redis) redis-cli
# ---------------------------------------------------------------------------
# DNS configuration for reliable pip installs during build
# ---------------------------------------------------------------------------
x-build-dns: &build-dns
network: host
services:
# ── Infrastructure ──────────────────────────────────────────────────────────
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-jobuser}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-jobpass}
POSTGRES_DB: ${POSTGRES_DB:-jobsdb}
volumes:
- pgdata:/var/lib/postgresql/data
# No ports exposed — access via: docker exec -it <container> psql -U jobuser jobsdb
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-jobuser} -d ${POSTGRES_DB:-jobsdb}"]
interval: 5s
timeout: 5s
retries: 10
networks: [jobnet]
restart: unless-stopped
redis:
image: redis:7-alpine
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru --appendonly yes
volumes:
- redis_data:/data
# No ports exposed — access via: docker exec -it <container> redis-cli
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
networks: [jobnet]
restart: unless-stopped
# ── Application Services ────────────────────────────────────────────────────
crawler:
build:
context: ./crawler-service
dockerfile: Dockerfile
<<: *build-dns
environment:
REDIS_HOST: redis
REDIS_PORT: "6379"
JOBSEEKER_ROLE: ${JOBSEEKER_ROLE:-Backend Engineer}
JOBSEEKER_STACK: ${JOBSEEKER_STACK:-Python,FastAPI,PostgreSQL,Redis,Go}
depends_on:
redis:
condition: service_healthy
restart: on-failure
networks: [jobnet]
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8004/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
aggregator:
build:
context: ./aggregator-service
dockerfile: Dockerfile
<<: *build-dns
environment:
REDIS_HOST: redis
REDIS_PORT: "6379"
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
networks: [jobnet]
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
scraper:
build:
context: ./scraper-service
dockerfile: Dockerfile
<<: *build-dns
environment:
REDIS_HOST: redis
REDIS_PORT: "6379"
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
depends_on:
redis:
condition: service_healthy
networks: [jobnet]
restart: on-failure
deploy:
resources:
limits:
memory: 1G
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
contact:
build:
context: ./contact-discovery-service
dockerfile: Dockerfile
<<: *build-dns
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
REDIS_HOST: redis
REDIS_PORT: "6379"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks: [jobnet]
restart: on-failure
deploy:
resources:
limits:
memory: 1G
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 45s
email-gen:
build:
context: ./email-generator-service
dockerfile: Dockerfile
<<: *build-dns
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
GMAIL_ADDRESS: ${GMAIL_ADDRESS:-}
GMAIL_APP_PASSWORD: ${GMAIL_APP_PASSWORD:-}
YOUR_NAME: ${YOUR_NAME:-Applicant}
YOUR_GITHUB_URL: ${YOUR_GITHUB_URL:-}
depends_on:
postgres:
condition: service_healthy
networks: [jobnet]
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8000/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
agent-search:
build:
context: ./agent-search-service
dockerfile: Dockerfile
<<: *build-dns
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
REDIS_HOST: redis
REDIS_PORT: "6379"
AGENT_PROVIDER: ${AGENT_PROVIDER:-ollama}
AGENT_MODEL: ${AGENT_MODEL:-mistral}
OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-http://host.docker.internal:11434}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks: [jobnet]
restart: on-failure
deploy:
resources:
limits:
memory: 512M
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8009/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
gemini-agent:
build:
context: ./gemini-agent-service
dockerfile: Dockerfile
<<: *build-dns
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-jobuser}:${POSTGRES_PASSWORD:-jobpass}@postgres:5432/${POSTGRES_DB:-jobsdb}
GEMINI_API_KEY: ${GEMINI_API_KEY:-}
AGGREGATOR_URL: http://aggregator:8000
SCRAPER_URL: http://scraper:8000
depends_on:
postgres:
condition: service_healthy
networks: [jobnet]
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8010/health || exit 1"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
gateway:
build:
context: ./gateway
dockerfile: Dockerfile
<<: *build-dns
ports:
- "${GATEWAY_PORT:-8080}:8080"
environment:
AGGREGATOR_URL: http://aggregator:8000
SCRAPER_URL: http://scraper:8000
CONTACT_URL: http://contact:8000
EMAIL_GEN_URL: http://email-gen:8000
AGENT_SEARCH_URL: http://agent-search:8009
GEMINI_AGENT_URL: http://gemini-agent:8010
CRAWLER_URL: http://crawler:8004
SUMMARY_PATH: /data/run_summary.json
JOBHUNTER_API_KEY: ${JOBHUNTER_API_KEY:-}
volumes:
- run_summary:/data:ro
depends_on:
aggregator:
condition: service_healthy
scraper:
condition: service_healthy
contact:
condition: service_healthy
email-gen:
condition: service_healthy
agent-search:
condition: service_healthy
networks: [jobnet]
restart: on-failure
healthcheck:
test: ["CMD-SHELL", "curl -sf http://localhost:8080/api/health || exit 1"]
interval: 15s
timeout: 10s
retries: 5
start_period: 30s
scheduler:
build:
context: ./scheduler
dockerfile: Dockerfile
<<: *build-dns
environment:
GATEWAY_URL: http://gateway:8080
CRAWLER_URL: http://crawler:8004
JOBHUNTER_API_KEY: ${JOBHUNTER_API_KEY:-}
JOBSEEKER_ROLE: ${JOBSEEKER_ROLE:-Backend Engineer}
JOBSEEKER_STACK: ${JOBSEEKER_STACK:-Python,FastAPI,PostgreSQL,Redis,Go}
CRAWL_INTERVAL_HOURS: ${CRAWL_INTERVAL_HOURS:-8}
DISCOVER_INTERVAL_HOURS: ${DISCOVER_INTERVAL_HOURS:-24}
SCRAPER_WAIT_SECS: ${SCRAPER_WAIT_SECS:-60}
DISCOVER_DELAY_SECS: ${DISCOVER_DELAY_SECS:-30}
SUMMARY_PATH: /data/run_summary.json
volumes:
- run_summary:/data
depends_on:
gateway:
condition: service_healthy
crawler:
condition: service_healthy
networks: [jobnet]
restart: on-failure
# ---------------------------------------------------------------------------
# Named volumes
# ---------------------------------------------------------------------------
volumes:
pgdata:
driver: local
redis_data:
driver: local
run_summary:
driver: local
# ---------------------------------------------------------------------------
# Networks
# ---------------------------------------------------------------------------
networks:
jobnet:
driver: bridge
driver_opts:
com.docker.network.bridge.name: jobnet0