-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
132 lines (121 loc) · 3.9 KB
/
Copy pathdocker-compose.yml
File metadata and controls
132 lines (121 loc) · 3.9 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
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
# No service publishes a host port. The tests reach every service by its
# compose service name over the project's private network (the browser in the
# selenium container hits http://nginx:80, the creator container reaches
# http://selenium:4444/wd/hub, and so on), so nothing needs a host port. Not
# publishing means several test runs - in this repo or in sibling repos - can
# run at once without fighting over the same host ports (eg 80, 4444). The demo
# overlay (docker-compose.demo.yml) publishes the few ports the demo needs.
services:
# The browser tests drive Firefox in the selenium container, which loads the
# app through this nginx - the same image production runs, so the tests
# exercise the real routing rather than a stub kept in step with it by hand.
# The /creator/ rate limit is turned up for the test run: several pages load
# in quick succession, each pulling html plus app.css and app.js through that
# zone, which is sized for a human at a keyboard. Every other zone keeps its
# production value, and nginx's own tests assert them.
nginx:
image: ${CYBER_DOJO_NGINX_IMAGE}:${CYBER_DOJO_NGINX_TAG}
platform: linux/amd64
user: root
init: true
environment:
# Passed through only when the caller sets it, which the browser-test
# run does (see bin/containers_up_healthy_and_clean.sh). Unset - as in
# the demo - nginx uses the production value baked into its image, so
# nothing here can silently disable a rate limit.
- CYBER_DOJO_CREATOR_CHOOSE_RATE
depends_on:
- creator
restart: "no"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
creator:
build:
args: [ COMMIT_SHA ]
context: .
image: ${CYBER_DOJO_CREATOR_IMAGE}:${CYBER_DOJO_CREATOR_TAG}
platform: linux/amd64
env_file: [ .env ]
user: ${CYBER_DOJO_CREATOR_SERVER_USER}
depends_on:
- custom-start-points
- exercises-start-points
- languages-start-points
- runner
- saver
read_only: true
restart: "no"
volumes:
- "./source/server:/app/source/:ro"
- "./test:/app/test/:ro"
- type: tmpfs
target: /tmp
tmpfs:
mode: 01777
size: 10485760 # 10MB
custom-start-points:
image: ${CYBER_DOJO_CUSTOM_START_POINTS_IMAGE}:${CYBER_DOJO_CUSTOM_START_POINTS_TAG}
platform: linux/amd64
user: nobody
env_file: [ .env ]
read_only: true
restart: "no"
volumes:
- type: tmpfs
target: /tmp
tmpfs:
mode: 01777
size: 10485760 # 10MB
exercises-start-points:
image: ${CYBER_DOJO_EXERCISES_START_POINTS_IMAGE}:${CYBER_DOJO_EXERCISES_START_POINTS_TAG}
platform: linux/amd64
user: nobody
env_file: [ .env ]
read_only: true
restart: "no"
volumes:
- type: tmpfs
target: /tmp
tmpfs:
mode: 01777
size: 10485760 # 10MB
languages-start-points:
image: ${CYBER_DOJO_LANGUAGES_START_POINTS_IMAGE}:${CYBER_DOJO_LANGUAGES_START_POINTS_TAG}
platform: linux/amd64
user: nobody
env_file: [ .env ]
read_only: true
restart: "no"
volumes:
- type: tmpfs
target: /tmp
tmpfs:
mode: 01777
size: 10485760 # 10MB
runner:
image: ${CYBER_DOJO_RUNNER_IMAGE}:${CYBER_DOJO_RUNNER_TAG}
platform: linux/amd64
user: root
env_file: [ .env ]
read_only: true
restart: "no"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- type: tmpfs
target: /tmp
tmpfs:
mode: 01777
size: 10485760 # 10MB
saver:
image: ${CYBER_DOJO_SAVER_IMAGE}:${CYBER_DOJO_SAVER_TAG}
platform: linux/amd64
user: saver
env_file: [ .env ]
init: true
read_only: true
restart: "no"
tmpfs:
- /cyber-dojo:uid=19663,gid=65533
- /tmp:uid=19663,gid=65533
selenium:
image: selenium/standalone-firefox
platform: linux/amd64