-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathdocker-compose.test.yml
More file actions
66 lines (63 loc) · 1.78 KB
/
docker-compose.test.yml
File metadata and controls
66 lines (63 loc) · 1.78 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
services:
# Service for running Go tests (unit + integration)
shock-test:
build:
context: .
dockerfile: Dockerfile.test
depends_on:
shock-mongo-test:
condition: service_healthy
shock-server-test:
condition: service_healthy
environment:
- SHOCK_SERVER_URL=http://shock-server-test:7445
- SHOCK_CONFIG=/etc/shock.d/shock-server-test.conf
volumes:
- .:/go/src/github.com/MG-RAST/Shock
- ./test-output:/test-output
- ./test:/etc/shock.d:ro
- shock-test-data:/var/log/shock/data
- shock-test-logs:/var/log/shock
entrypoint: ""
command: ["go", "test", "-mod=vendor", "-v", "./shock-server/integration/...", "./shock-server/router/..."]
# Shock server for integration testing
shock-server-test:
build:
context: .
dockerfile: Dockerfile
depends_on:
shock-mongo-test:
condition: service_healthy
environment:
- MONGO_HOST=shock-mongo-test
volumes:
- ./test:/etc/shock.d
- shock-server-test-data:/var/log/shock/data
- shock-server-test-logs:/var/log/shock
command: ["/go/bin/shock-server", "-conf", "/etc/shock.d/shock-server-test.conf"]
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:7445/"]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
# MongoDB for testing
shock-mongo-test:
image: mongo:3.6
ports:
- "27017"
volumes:
- shock-mongo-test-data:/data/db
healthcheck:
test: ["CMD", "mongo", "--eval", "db.adminCommand('ping')"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
command: --smallfiles
volumes:
shock-test-data:
shock-test-logs:
shock-mongo-test-data:
shock-server-test-data:
shock-server-test-logs: