-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yaml
398 lines (359 loc) · 13.1 KB
/
docker-compose.yaml
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
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
version: "3"
services:
nginx_server:
image: nginx
ports:
- 80:80
volumes:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
depends_on:
- fake_sudir
- fake_mdm
- deg_ballot
fake_mdm:
build: ./fake_mdm
postgres_sudir:
image: postgres
restart: always
ports:
- 5433:5432
environment:
POSTGRES_USER: sudir_user
POSTGRES_PASSWORD: sudir_user_password
POSTGRES_DB: sudir_db
PGDATA: /postgres_data
volumes:
- ./storage/postgres_sudir_data:/postgres_data
fake_sudir:
build: ./fake_sudir
volumes:
- ./storage/fake_sudir_db:/app/database
depends_on:
- postgres_sudir
environment:
AUTHLIB_INSECURE_TRANSPORT: 1
TELEGRAM_BOT_SECRET: "telegram_bot_secret"
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
SQLALCHEMY_DATABASE_URI: "postgresql://sudir_user:sudir_user_password@postgres_sudir:5432/sudir_db"
fake_sudir_bot:
build: ./fake_sudir_bot
command: python /app/bot.py
environment:
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_BOT_SECRET: "telegram_bot_secret"
FAKE_SUDIR_URL: http://fake_sudir
rabbit_mq:
ports:
- 5672:5672
- 15672:15672
image: rabbitmq:3-management
hostname: 'mabbit'
volumes:
- ./storage/rabbitmq_data:/var/lib/rabbitmq/mnesia/
redis:
image: redis
ports:
- 6379:6379
volumes:
- ./storage/redis_deg_data:/data
redis_admin:
image: erikdubbelboer/phpredisadmin
ports:
- 8081:80
environment:
- ADMIN_USER=admin
- ADMIN_PASS=admin
- REDIS_1_HOST=redis
- REDIS_1_PORT=6379
depends_on:
- redis
postgres:
image: postgres
restart: always
ports:
- 5432:5432
environment:
POSTGRES_USER: deg_user
POSTGRES_PASSWORD: deg_user_password
POSTGRES_DB: deg_ballot_db
PGDATA: /postgres_data
volumes:
- ./storage/postgres_deg_data:/postgres_data
pg_adminer:
image: adminer
restart: always
ports:
- 8082:8080
depends_on:
- postgres
- postgres_sudir
blockchain_public:
command: /bin/bash -c "/launch.sh"
build:
context: ./deg_codebase/blockchain/dit-blockchain-source
dockerfile: ${PWD}/rust_env/Dockerfile
volumes:
- ./rust_env/launch.sh:/launch.sh
- ./rust_env/public_blockchain_config.yaml:/launch_config.yaml
- ./storage/dit_public_blockchain:/storage
ports:
- 9000:8000
- 9001:8001
- 9002:8002
- 9003:8003
- 9004:8004
- 9005:8005
- 9006:8006
- 9007:8007
environment:
PROGRAM_NAME: dit-voting-blockchain
blockchain_public_explorer:
build: ./blockchain_explorer
ports:
- 3000:80
environment:
PUBLIC_API: http://blockchain_public:8000
PRIVATE_API: http://blockchain_public:8004
blockchain_private:
command: /bin/bash -c "/launch.sh"
build:
context: ./deg_codebase/blockchain/dit-blockchain-private-source
dockerfile: ${PWD}/rust_env/Dockerfile
volumes:
- ./rust_env/launch.sh:/launch.sh
- ./rust_env/private_blockchain_config.yaml:/launch_config.yaml
- ./storage/dit_private_blockchain:/storage
ports:
- 9100:8000
- 9101:8001
- 9102:8002
- 9103:8003
- 9104:8004
- 9105:8005
- 9106:8006
- 9107:8007
environment:
PROGRAM_NAME: dit-voting-blockchain-private
blockchain_private_explorer:
build: ./blockchain_explorer
ports:
- 3100:80
environment:
PUBLIC_API: http://blockchain_private:8000
PRIVATE_API: http://blockchain_private:8004
blockchain_service:
command: python /app/blockchain_service.py
build: ./fake_blockchain_connector/blockchain_votes_processor
ports:
- 8026:80
depends_on:
- blockchain_public
- postgres
- postgres_sudir
- deg_encryptor
- stribog512
environment:
RE_ENCRYPTOR_PRIVATE_KEY_HEX: 65a6f2ecb8482b3a96696e36f55ac7726e641ab0add4e137eb3d84d40985abe4
BLOCKCHAIN_SERVICE_LISTEN_PORT: 80
BLOCKCHAIN_API_HOSTNAME: blockchain_public
BLOCKCHAIN_API_PUBLIC_PORT: 8000
BLOCKCHAIN_API_PRIVATE_PORT: 8004
BLOCKCHAIN_API_PRIVATE_KEY: "0063d0ccd28f3212ef40b5cd04508a602afa3317d2c0314d522b664bdce913b7f5d824aca5423c145125186d79e9f6a44100158faa02ee162dc75b1e54bc9409"
BLOCKCHAIN_API_PUBLIC_KEY: "f5d824aca5423c145125186d79e9f6a44100158faa02ee162dc75b1e54bc9409"
FORGING_DO_FORGING: true
FORGING_DB_HOST: postgres
FORGING_DB_PORT: 5432
FORGING_DB_USER: "deg_user"
FORGING_DB_PASSWORD: "deg_user_password"
FORGING_DB_DATABASE: "deg_ballot_db"
DEANONIMIZATION_DECRYPT_URL: "http://deg_encryptor:8001/api/encryption/decrypt"
DEANONIMIZATION_DECRYPT_SYSTEM: "componentX"
DEANONIMIZATION_DECRYPT_TOKEN: "componentX_token"
DEANONIMIZATION_STRIBOG_SERVICE: "http://stribog512"
DEANONIMIZATION_MDM_SECRET: "1b58f1bc0c88f6f864ead6bd916b5ed5c00b3f398bac43a4f65bc213ecd19494"
DEANONIMIZATION_COMPONENT_X_SECRET: "0faa344b82b8900b2d23aefb2e157e2139a5e6d0b6c74ad8a05bdaf3e2d34bee"
DEANONIMIZATION_SUDIR_SQLALCHEMY_URL: "postgresql+asyncpg://sudir_user:sudir_user_password@postgres_sudir:5432/sudir_db"
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
blockchain_proxy:
build:
context: .
dockerfile: ./fake_blockchain_connector/blockchain_proxy/Dockerfile
ports:
- 8021:80
depends_on:
- blockchain_private
- blockchain_public
environment:
API_URL: http://blockchain_public:8000
PRIVATE_API_URL: http://blockchain_private:8000
LISTEN_PORT: 80
postgres_arm:
image: postgres
restart: always
ports:
- 5434:5432
environment:
POSTGRES_USER: arm_user
POSTGRES_PASSWORD: arm_user_password
POSTGRES_DB: arm_db
PGDATA: /postgres_data
volumes:
- ./storage/postgres_sudir_dara:/postgres_data
fake_arm:
build: ./fake_arm
volumes:
- ./storage/fake_arm:/app/database
ports:
- 8022:80
depends_on:
- blockchain_proxy
- blockchain_service
- postgres_arm
environment:
BLOCKCHAIN_PROXY_URI: http://blockchain_proxy
BLOCKCHAIN_SERVICE_URI: http://blockchain_service
SQLALCHEMY_DATABASE_URI: "postgresql://arm_user:arm_user_password@postgres_arm:5432/arm_db"
re_encrypt_service:
command: python /app/re_encrypt_service.py
build: ./fake_blockchain_connector/blockchain_votes_processor
ports:
- 8025:80
environment:
RE_ENCRYPTOR_LISTEN_PORT: 80
RE_ENCRYPTOR_PRIVATE_KEY_HEX: 65a6f2ecb8482b3a96696e36f55ac7726e641ab0add4e137eb3d84d40985abe4
blockchain_votes_processor:
build: ./fake_blockchain_connector/blockchain_votes_processor
ports:
- 8024:80
depends_on:
- fake_arm
- blockchain_proxy
- rabbit_mq
- deg_encryptor
environment:
BLOCKCHAIN_PROXY_URI: http://blockchain_proxy/process_vote
ARM_VOITING_URL: "http://fake_arm/arm/config?empty_ok=true"
LISTEN_PORT: 80
RABBIT_MQ_HOSTNAME: rabbit_mq
ENCRYPTOR_URL: http://deg_encryptor:8001
base_deg_php_not_service:
build:
context: ./php_env
dockerfile: Dockerfile-base-env
image: deg_php_base_context
deg_encryptor:
build:
context: ./deg_codebase/form/encryptor
dockerfile: ${PWD}/php_env/Dockerfile
ports:
- 8028:8001
volumes:
- ./sample_deg_configs/encryptor/config:/app/config
- ./sample_deg_configs/encryptor/.env:/app/.env
- ./storage/encryptor/logs:/app/storage/logs
- ./storage/encryptor/framework:/app/storage/framework
depends_on:
- base_deg_php_not_service
deg_componentx:
build:
context: ./deg_codebase/form/componentX
dockerfile: ${PWD}/php_env/Dockerfile
volumes:
- ./sample_deg_configs/componentX/config:/app/config
- ./sample_deg_configs/componentX/.env:/app/.env
- ./storage/componentx/logs:/app/storage/logs
- ./storage/componentx/framework:/app/storage/framework
depends_on:
- base_deg_php_not_service
- deg_encryptor
- fake_mdm
- redis
- nginx_server
- fake_arm
environment:
REDIS_HOST: redis
ENCRYPTOR_GID_HOST: http://deg_encryptor:8001
ARM_VOITING_URL: http://fake_arm/arm/config
deg_ballot:
build:
context: ./deg_codebase/form/ballot
dockerfile: ${PWD}/php_env/Dockerfile
volumes:
- ./sample_deg_configs/ballot/config:/app/config
- ./sample_deg_configs/ballot/.env:/app/.env
- ./storage/ballot/logs:/app/storage/logs
- ./storage/ballot/framework:/app/storage/framework
- ./storage/ballot/framework/sessions:/app/storage/framework/sessions
- ./storage/ballot/framework/views:/app/storage/framework/views
- ./storage/ballot/framework/cache:/app/storage/framework/cache
- ./storage/ballot/migrations_file_folder:/app/migrations_file_folder
depends_on:
- base_deg_php_not_service
- deg_encryptor
- postgres
- redis
- rabbit_mq
- fake_arm
- re_encrypt_service
environment:
REDIS_HOST: redis
DB_HOST: postgres
AMQP_HOST: rabbit_mq
WAIT_FOR_AMQP: 'true'
RUN_MIGRATIONS: 'true'
CHECK_MIGRATIONS_FILE: /app/migrations_file_folder/migrations_applied
RE_ENCRYPT_URL: http://re_encrypt_service/blockchain_re_encryptor/re_encrypt
ENCRYPTOR_GID_HOST: http://deg_encryptor:8001
ENCRYPTOR_HOST: http://deg_encryptor:8001
ARM_VOITING_URL: "http://fake_arm/arm/config?empty_ok=true"
ARM_VOITING_REF: http://fake_arm/arm/
APP_URL: http://${HOSTNAME:-localhost}/anon_zone/
APP_HTTP_PROTOCOL: http
deg_form:
build:
context: ./deg_codebase/form/form
dockerfile: ${PWD}/php_env/Dockerfile
volumes:
- ./sample_deg_configs/form/config:/app/config
- ./sample_deg_configs/form/.env:/app/.env
- ./storage/form/logs:/app/storage/logs
- ./storage/form/framework:/app/storage/framework
- ./storage/form/framework/sessions:/app/storage/framework/sessions
- ./storage/form/framework/views:/app/storage/framework/views
- ./storage/form/framework/cache:/app/storage/framework/cache
depends_on:
- base_deg_php_not_service
- fake_sudir
- deg_encryptor
- deg_ballot
- deg_componentx
- redis
- fake_arm
environment:
REDIS_HOST: redis
DB_HOST: postgres
AMQP_HOST: rabbit_mq
WAIT_FOR_AMQP: 'true'
ENCRYPTOR_GID_HOST: http://deg_encryptor:8001
ENCRYPTOR_HOST: http://deg_encryptor:8001
VOTING_EXTERNAL_ID_HOST: http://deg_componentx:8002
BALLOT_EXTERNAL_HOST: /anon_zone
BALLOT_EXTERNAL_PORT: ""
BALLOT_GET_GUID_URL: http://deg_ballot:8003/ballot/getGuid
ARM_VOITING_URL: http://fake_arm/arm/config
ARM_VOITING_REF: http://fake_arm/arm/
SUDIR_LOGIN_URL: /oauth/authorize
SUDIR_TOKEN_URL: http://fake_sudir/oauth/token
SUDIR_USER_DATA_URL: http://fake_sudir/api/me
SUDIR_SEND_TELEGRAM_MESSAGE_URL: http://fake_sudir/oauth/tg/send_message
TELEGRAM_BOT_SECRET: "telegram_bot_secret"
#APP_URL:
#APP_HTTP_PROTOCOL: http
#APP_STATIC_URL: /common/static
stribog512:
build:
context: ./stribog512_php
ports:
- 8027:80
environment:
PORT: 80