-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (94 loc) · 2.48 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (94 loc) · 2.48 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_USER: pricehawk
POSTGRES_PASSWORD: password
POSTGRES_DB: pricehawk
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
app:
build:
context: .
dockerfile: Dockerfile
command: node server.js
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
NEXT_PUBLIC_APP_URL: http://localhost:3000
ports:
- "3000:3000"
depends_on:
- postgres
- redis
# Separate service for Scraper because it needs Playwright browsers
# We use the official Playwright image to ensure browsers are there
worker-scraper:
image: mcr.microsoft.com/playwright:v1.49.0-jammy
working_dir: /app
# We mount the code to run it
volumes:
- ./:/app
- /app/node_modules
command: /bin/bash -c "npm install && npx prisma generate && npx tsx src/worker.ts"
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
# Other workers can use the base App image (lighter) or the same playwright image if code is shared
worker-validator:
build: .
command: tsx src/workers/anomaly-validator.ts
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
worker-notify:
build: .
command: tsx src/workers/notification-sender.ts
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
worker-social:
build: .
command: tsx src/workers/social-poster.ts
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
worker-verifier:
build: .
command: tsx src/workers/deal-verifier.ts
environment:
DATABASE_URL: postgres://pricehawk:password@postgres:5432/pricehawk
REDIS_HOST: redis
REDIS_PORT: 6379
depends_on:
- postgres
- redis
volumes:
postgres_data:
redis_data: