-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
190 lines (173 loc) · 5.17 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
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
version: '3'
services:
### rebuilder_base
base:
image: rebuilder_base
build:
context: .
dockerfile: Dockerfile
### Celery
broker:
restart: always
image: 'docker.io/redis'
ports:
- '6379:6379'
backend:
restart: always
# 'docker.io/mongo'
image: 'docker.io/mongo:4.4.8'
ports:
- '27017:27017'
volumes:
- '/var/lib/rebuilder/backend:/data/db'
command: --quiet
beat:
restart: always
image: 'rebuilder_base'
volumes:
- .:/app
depends_on:
- broker
links:
- broker
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
# https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html?highlight=periodic#starting-the-scheduler
entrypoint: celery -A app worker -B -s /tmp/celerybeat-schedule --loglevel=INFO
flower:
image: mher/flower
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
- FLOWER_PORT=5556
ports:
- 5556:5556
# This is for monitoring easier Redis with a web interface
phpredisadmin:
restart: always
image: 'erikdubbelboer/phpredisadmin'
depends_on:
- broker
links:
- broker
ports:
- '8080:80'
environment:
- REDIS_1_HOST=broker
- REDIS_1_NAME=broker
# This is for monitoring easier MongoDB with a web interface
mongo-express:
restart: always
image: 'docker.io/mongo-express'
depends_on:
- backend
links:
- backend
ports:
- '8081:8081'
environment:
- ME_CONFIG_MONGODB_URL=mongodb://backend:27017
### PackageRebuilder
getter:
restart: always
image: 'rebuilder_base'
volumes:
- .:/app
# uploader worker needs in-toto directory for checking if metadata exists
- '/var/lib/rebuilder/rebuild:/var/lib/rebuilder/rebuild'
depends_on:
- broker
- backend
links:
- broker
- backend
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
# https://docs.celeryproject.org/en/latest/userguide/periodic-tasks.html?highlight=periodic#starting-the-scheduler
entrypoint: celery -A app worker --loglevel=INFO -O fair --prefetch-multiplier 1 -c 1 --queues=get
rebuilder:
restart: always
privileged: true
build:
context: .
dockerfile: rebuilder.Dockerfile
volumes:
- .:/app
# rebuilder worker(s) need(s) artifacts directory
- '/var/lib/rebuilder/artifacts:/var/lib/rebuilder/artifacts'
depends_on:
- broker
- backend
links:
- broker
- backend
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
# https://docs.celeryproject.org/en/stable/reference/cli.html#cmdoption-celery-worker-c
entrypoint: celery -A app worker --loglevel=INFO -O fair --prefetch-multiplier 1 -c 1 --queues=rebuild
# This is for specifing the number of rebuilder worker. Alternatively, you can use: docker-compose scale rebuilder=X
deploy:
mode: replicated
replicas: 0
attester:
restart: always
privileged: true
build:
context: .
dockerfile: rebuilder.Dockerfile
volumes:
- .:/app
# attester need artifacts directory, in-toto repository and GPG for signing in-toto metadata
- '/var/lib/rebuilder/artifacts:/var/lib/rebuilder/artifacts'
- '/var/lib/rebuilder/rebuild:/var/lib/rebuilder/rebuild'
- '/var/lib/rebuilder/gnupg:/root/.gnupg'
depends_on:
- broker
- backend
links:
- broker
- backend
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
# https://docs.celeryproject.org/en/stable/reference/cli.html#cmdoption-celery-worker-c
entrypoint: celery -A app worker --loglevel=INFO -O fair --prefetch-multiplier 1 -c 1 --queues=attest
reporter:
restart: always
image: 'rebuilder_base'
volumes:
- .:/app
# reporter worker needs artifacts, and in-toto directory
- '/var/lib/rebuilder/artifacts:/var/lib/rebuilder/artifacts'
- '/var/lib/rebuilder/rebuild:/var/lib/rebuilder/rebuild'
depends_on:
- broker
- backend
links:
- broker
- backend
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
entrypoint: celery -A app worker --loglevel=INFO -O fair --prefetch-multiplier 1 -c 1 --queues=report
uploader:
restart: always
image: 'rebuilder_base'
volumes:
- .:/app
# uploader worker needs in-toto directory and SSH key for rsyncing on remote location
- '/var/lib/rebuilder/rebuild:/var/lib/rebuilder/rebuild'
- '/var/lib/rebuilder/ssh:/root/.ssh'
depends_on:
- broker
- backend
links:
- broker
- backend
environment:
- CELERY_BROKER_URL=redis://broker:6379/0
- CELERY_RESULT_BACKEND=mongodb://backend:27017
entrypoint: celery -A app worker --loglevel=INFO -O fair --prefetch-multiplier 1 -c 1 --queues=upload