-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdocker-compose.yml
85 lines (81 loc) · 2.54 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
services:
contest:
build:
context: .
dockerfile: docker/contest/Dockerfile
command: bash -c "cd /go/src/github.com/linuxboot/contest/cmds/contest/ && go run . -dbURI 'contest:contest@tcp(dbstorage:3306)/contest_integ?parseTime=true' -adminServerAddr 'http://adminserver:8000'"
ports:
- 8080:8080
depends_on:
mysql:
condition: service_healthy
admin-server:
condition: service_healthy
networks:
- net
mysql:
environment:
- MYSQL_RANDOM_ROOT_PASSWORD=true
build:
context: .
dockerfile: docker/mysql/Dockerfile
ports:
- 3306:3306
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h127.0.0.1",
"-ucontest",
"-pcontest"
]
interval: 5s
timeout: 1s
retries: 10
networks:
net:
aliases:
- dbstorage
admin-server:
build:
context: .
# using the same dockerfile as it copies the whole context repo
# then we run admin_server from the cmds
dockerfile: docker/contest/Dockerfile
command: bash -c "cd /go/src/github.com/linuxboot/contest/cmds/admin_server/ && go run . -port 8000 -dbURI 'mongodb://mongostorage:27017' -contestdbURI 'contest:contest@tcp(dbstorage:3306)/contest_integ?parseTime=true'"
ports:
- 8000:8000
healthcheck:
test: curl --fail -X GET http://localhost:8000/status || exit 1
interval: 5s
timeout: 1s
retries: 10
depends_on:
mysql:
condition: service_healthy
mongo:
condition: service_healthy
networks:
net:
aliases:
- adminserver
mongo:
build:
context: .
dockerfile: docker/mongo/Dockerfile
command: mongod --port 27017 --quiet --logpath /dev/null
ports:
- 27017:27017
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo localhost:27017/admin-server-db --quiet
interval: 5s
timeout: 1s
retries: 10
networks:
net:
aliases:
- mongostorage
networks:
net: