-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
179 lines (159 loc) · 3.63 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
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
version: '3'
services:
nsjail:
restart: 'no'
build: ./nsjail
networks: []
ctfd_db:
restart: always
image: mariadb:10.4.7
environment:
- MYSQL_ROOT_PASSWORD=ctfd
- MYSQL_USER=ctfd
- MYSQL_PASSWORD=ctfd
- MYSQL_DATABASE=ctfd
volumes:
- ./docker_volumes/ctfd/logs:/var/log
- ./docker_volumes/ctfd/mysql:/var/lib/mysql
expose:
- 3306
ports:
- '3306:3306'
networks:
- ctfd
# This command is required to set important mariadb defaults
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --wait_timeout=28800, --log-warnings=0]
ctfd_cache:
restart: always
image: redis:5.0.5
user: root
volumes:
- ./docker_volumes/ctfd/logs:/var/log
- ./docker_volumes/ctfd/redis:/data
expose:
- 6379
ports:
- '6379:6379'
networks:
- ctfd
ctfd:
restart: always
build: ./CTFd/
depends_on:
- ctfd_db
- ctfd_cache
user: root
environment:
- HOST=0.0.0.0
- PORT=8000
- DATABASE_URL=mysql+pymysql://ctfd:ctfd@ctfd_db:3306/ctfd
- REDIS_URL=redis://ctfd_cache:6379
- WORKERS=1
- LOG_FOLDER=/var/log/CTFd
- UPLOAD_FOLDER=/var/uploads
- ACCESS_LOG=/var/log/CTFd/access_log
- ERROR_LOG=-
- USE_RELOAD=false
volumes:
- ./docker_volumes/ctfd/logs:/var/log
- ./docker_volumes/ctfd/uploads:/var/uploads
- ./CTFd:/opt/CTFd:ro
expose:
- 8000
ports:
- '127.0.0.1:1337:8000'
networks:
- default
- ctfd
tasks:
restart: 'no'
image: tianon/true
depends_on:
- ctfd # Some of the tasks are on the platform itself.
- template_polyglot
- cookie_sqli
networks: []
tests:
restart: always
build: ./tests/
depends_on:
- tasks
environment:
- CTFT_ENV=devel
- CTFT_BASE_URL=http://ctfd:8000/
- CTFT_TEMPLATE_POLYGLOT_URL=http://template_polyglot:8000/
volumes:
- ./docker_volumes/tests:/tests/artifacts
- ./tasks:/tests/tasks:ro
networks:
- default
template_polyglot:
restart: always
build: ./tasks/template_polyglot/task/
environment:
- HOST=0.0.0.0
- PORT=8000
expose:
- 8000
ports:
- '127.0.0.1:1338:8000'
networks:
- default
cookie_sqli_db:
restart: always
image: postgres:11.5-alpine
environment:
- POSTGRES_APP_USER=cookie_sqli
- POSTGRES_APP_PASSWORD=cookie_sqli
- POSTGRES_USER=cookie_sqli_super
- POSTGRES_PASSWORD=cookie_sqli_super
- POSTGRES_DB=cookie_sqli
# Don't need persistent volume for task.
volumes:
- ./tasks/cookie_sqli/task/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- '5432:5432'
networks:
- cookie_sqli
cookie_sqli:
restart: always
build: ./tasks/cookie_sqli/task/
depends_on:
- cookie_sqli_db
environment:
- HOST=0.0.0.0
- PORT=8000
- POSTGRES_HOST=cookie_sqli_db
- POSTGRES_USER=cookie_sqli
- POSTGRES_PASSWORD=cookie_sqli
- POSTGRES_DB=cookie_sqli
ports:
- '127.0.0.1:1339:80'
networks:
- default
- cookie_sqli
cssinjweb:
restart: always
build: ./tasks/css_inj/web/
expose:
- 8000
ports:
- '127.0.0.1:1340:8000'
networks:
- default
- css_inj
cssinjbot:
restart: always
build: ./tasks/css_inj/bot/
depends_on:
- cssinjweb
networks:
- default
- css_inj
networks:
ctfd:
internal: true
cookie_sqli:
internal: true
css_inj:
internal: true