-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
127 lines (116 loc) · 3.98 KB
/
docker-compose.yml
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
version: '3.8'
services:
database:
image: postgres:15.7-alpine
ports:
- "5435:5432"
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
POSTGRES_HOST_AUTH_METHOD: "trust"
PGPORT: "5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1s
timeout: 14s
retries: 15
start_period: 2m
redis:
image: redis
ports:
- "6379:6379"
redis-celery-broker:
image: redis
ports:
- "6380:6380"
command: ["redis-server", "--port", "6380"]
ranker:
build:
context: .
dockerfile: docker/Dockerfile.ranking_server
depends_on:
- redis
environment:
REDIS_CONNECTION_STRING: redis://redis:6379
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["poetry", "run", "uvicorn", "ranking_server.ranking_server:app", "--host", "0.0.0.0", "--port", "8001", "--log-config", "ranking_server/logging_config.yaml"]
ports:
- "8001:8001"
celery-worker:
build:
context: .
dockerfile: docker/Dockerfile.sandbox_worker
depends_on:
- redis
- redis-celery-broker
environment:
REDIS_CONNECTION_STRING: redis://redis:6379
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
POSTS_DB_URI: postgres://postgres:postgres@database:5432/posts?sslmode=disable
command: ["poetry", "run", "celery", "-A", "sandbox_worker.tasks", "worker", "-Q", "tasks", "--loglevel=info"]
celery-scorer-worker0:
build:
context: .
dockerfile: docker/Dockerfile.scorer_worker
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["poetry", "run", "celery", "-A", "scorer_worker.tasks", "worker", "-Q", "scorer", "--loglevel=info"]
celery-scorer-worker1:
build:
context: .
dockerfile: docker/Dockerfile.scorer_worker
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["poetry", "run", "celery", "-A", "scorer_worker.tasks", "worker", "-Q", "scorer", "--loglevel=info"]
celery-scraper-worker0:
build:
context: .
dockerfile: docker/Dockerfile.scraper_worker.scraper
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
SCRAPER_DB_URI: postgres://postgres:postgres@database:5432/scraper?sslmode=disable
TWITTER_SESSION_COOKIE: ${TWITTER_SESSION_COOKIE}
TWITTER_USERNAME: ${TWITTER_USERNAME}
TWITTER_EMAIL: ${TWITTER_EMAIL}
RESULTS_ENDPOINT: http://scraper-ingester:8002/data/scraper
command: ["poetry", "run", "celery", "-A", "scraper_worker.tasks", "worker", "-Q", "scraper", "--loglevel=info"]
scraper-ingester:
build:
context: .
dockerfile: docker/Dockerfile.scraper_worker.ingester
ports:
- "8002:8002"
volumes:
- .:/app
- ../../sample_data:/data
environment:
SCRAPER_DB_URI: postgres://postgres:postgres@database:5432/scraper?sslmode=disable
PYTHONPATH: /app/examples/combined
command: ["poetry", "run", "uvicorn", "scraper_worker.ingester:app", "--host", "0.0.0.0", "--port", "8002"]
job-scheduler:
build:
context: .
dockerfile: docker/Dockerfile.job_scheduler
depends_on:
- redis-celery-broker
environment:
CELERY_BROKER: redis://redis-celery-broker:6380
CELERY_BACKEND: redis://redis-celery-broker:6380
command: ["poetry", "run", "celery", "-A", "job_scheduler.scheduler", "beat", "-S", "redbeat.RedBeatScheduler", "--loglevel=info"]
volumes:
postgres_data:
driver: local