-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
88 lines (82 loc) · 2.36 KB
/
docker-compose.yml
File metadata and controls
88 lines (82 loc) · 2.36 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
# This will spin up multiple parallel containers:
# - One for each API under test
# - one for each infrastructure component
# - One to house the test runner
#
# The test runner will wait for both API containers to run, and validate that
# the APIs have started by checking their ping endpoints.
#
# This should be run with the --build and --abort-on-container-exit flags
version: "3.8"
services:
messagequeue:
image: rabbitmq:3.8.16-management-alpine
container_name: "postman-electionguard-message-queue"
expose:
- 5672
- 15672
ports:
- 5672:5672
- 15672:15672
mediator:
build:
context: ../..
target: prod
expose:
- 80
environment:
API_MODE: "mediator"
QUEUE_MODE: "remote"
STORAGE_MODE: "mongo"
PROJECT_NAME: "ElectionGuard Mediator API"
PORT: 80
MESSAGEQUEUE_URI: "amqp://guest:guest@postman-electionguard-message-queue:5672"
MONGODB_URI: "mongodb://root:example@postman-electionguard-db:27017"
guardian:
build:
context: ../..
target: prod
expose:
- 80
environment:
API_MODE: "guardian"
QUEUE_MODE: "remote"
STORAGE_MODE: "mongo"
PROJECT_NAME: "ElectionGuard Guardian API"
PORT: 80
MESSAGEQUEUE_URI: "amqp://guest:guest@postman-electionguard-message-queue:5672"
MONGODB_URI: "mongodb://root:example@postman-electionguard-db:27017"
mongo:
image: mongo
container_name: "postman-electionguard-db"
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
MONGO_INITDB_DATABASE: BallotData
volumes:
- ./mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
mongo-express:
image: mongo-express
restart: always
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: root
ME_CONFIG_MONGODB_ADMINPASSWORD: example
links:
- "mongo"
test-runner:
build:
context: .
depends_on:
- mediator
- guardian
volumes:
- ".:/tests"
entrypoint: dockerize
command:
-wait http://guardian/api/v1/ping -wait http://mediator/api/v1/ping -timeout 10s
bash -c "newman run /tests/*.postman_collection.json --timeout-request 60000 --env-var guardian-url=http://guardian --env-var mediator-url=http://mediator"