forked from hust-open-atom-club/pwn.hust.college
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
183 lines (173 loc) · 4.7 KB
/
docker-compose.yml
File metadata and controls
183 lines (173 loc) · 4.7 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
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
180
181
182
183
version: '3.4'
services:
challenge:
build:
context: ./challenge
target: challenge-final
args:
- INSTALL_IDA=${INSTALL_IDA}
- UBUNTU_VERSION=${UBUNTU_VERSION}
- DOJO_CHALLENGE=${DOJO_CHALLENGE}
platform: linux/amd64
entrypoint: /bin/true
networks:
- user_network
ctfd:
container_name: ctfd
hostname: ctfd
build: /opt/CTFd
platform: linux/amd64
user: root
restart: always
privileged: true
entrypoint: ""
command: >
/bin/sh -c '[ "$DOJO_ENV" != "development" ] &&
./docker-entrypoint.sh ||
FLASK_ENV=development WERKZEUG_DEBUG_PIN=off flask run --host 0.0.0.0 --port 8000'
ulimits:
nofile:
soft: 32768
hard: 1048576
environment:
- UPLOAD_FOLDER=/var/uploads
- DATABASE_URL=mysql+pymysql://ctfd:ctfd@db/ctfd
- REDIS_URL=redis://cache:6379
- WORKERS=8
- LOG_FOLDER=/var/log/CTFd
- ACCESS_LOG=-
- ERROR_LOG=-
- REVERSE_PROXY=true
- SERVER_SENT_EVENTS=false
- SECRET_KEY=${SECRET_KEY}
- DOJO_HOST=${DOJO_HOST}
- HOST_DATA_PATH=/opt/pwn.college/data
- MAIL_SERVER=${MAIL_SERVER}
- MAIL_PORT=${MAIL_PORT}
- MAIL_USERNAME=${MAIL_USERNAME}
- MAIL_PASSWORD=${MAIL_PASSWORD}
- MAIL_ADDRESS=${MAIL_ADDRESS}
- INTERNET_FOR_ALL=${INTERNET_FOR_ALL}
- WINDOWS_VM=${WINDOWS_VM}
- VIRTUAL_HOST=${DOJO_HOST},localhost
- VIRTUAL_PORT=8000
- LETSENCRYPT_HOST=${DOJO_HOST}
volumes:
- ./data:/var/data
- ./data/CTFd/logs:/var/log/CTFd
- ./data/CTFd/uploads:/var/uploads
- ./data/homes:/var/homes:shared
- ./data/challenges:/var/challenges:ro
- ./data/dojos:/var/dojos
- ./data/ssh_host_keys/ssh_known_hosts:/etc/ssh/ssh_known_hosts:ro
- ./index.html:/var/index.html:ro
- ./user_firewall.allowed:/var/user_firewall.allowed:ro
- /etc/docker/seccomp.json:/etc/docker/seccomp.json:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /opt/pwn.college/dojo_plugin:/opt/CTFd/CTFd/plugins/dojo_plugin:ro
- /opt/pwn.college/dojo_theme:/opt/CTFd/CTFd/themes/dojo_theme:ro
healthcheck:
test:
- "CMD"
- "python"
- "-c"
- |
import requests
response = requests.get('http://localhost:8000')
response.raise_for_status()
interval: 10s
timeout: 10s
retries: 3
depends_on:
db:
condition: service_healthy
restart: true
cache:
condition: service_started
db:
container_name: db
image: mariadb:10.4.12
restart: always
environment:
- MYSQL_ROOT_PASSWORD=ctfd
- MYSQL_USER=ctfd
- MYSQL_PASSWORD=ctfd
- MYSQL_DATABASE=ctfd
volumes:
- ./data/mysql:/var/lib/mysql
command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --wait_timeout=28800, --log-warnings=0]
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-pctfd"]
interval: 10s
timeout: 10s
retries: 3
cache:
container_name: cache
image: redis:4
restart: always
volumes:
- ./data/redis:/data
sshd:
container_name: sshd
build:
context: ./sshd
volumes:
- ./data/ssh_host_keys:/etc/ssh:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- "22:22"
nginx:
container_name: nginx
image: nginxproxy/nginx-proxy
restart: always
ports:
- "80:80"
- "443:443"
environment:
- DOCKER_HOST=unix:///tmp/${DOCKER_PSLR}/docker.sock
volumes:
- conf:/etc/nginx/conf.d
- html:/usr/share/nginx/html
- dhparam:/etc/nginx/dhparam
- certs:/etc/nginx/certs:ro
- ./nginx-proxy/etc/nginx/vhost.d:/etc/nginx/vhost.d
- ./nginx-proxy/etc/passwd:/etc/passwd:ro
- ./data/homes:/var/homes:shared
- /var/run/docker.sock:/tmp/${DOCKER_PSLR}/docker.sock:ro
networks:
default:
user_network:
aliases:
- nginx
ipv4_address: 10.0.0.3
nginx-certs:
container_name: nginx_certs
image: nginxproxy/acme-companion
restart: always
volumes_from:
- nginx
volumes:
- certs:/etc/nginx/certs:rw
- acme:/etc/acme.sh
- /var/run/docker.sock:/var/run/docker.sock:ro
windows:
extends:
file: ./windows/${WINDOWS_VM}.yml
service: windows
volumes:
conf:
html:
dhparam:
certs:
acme:
windows:
networks:
user_network:
name: user_network
driver: bridge
ipam:
config:
- subnet: 10.0.0.0/8
driver_opts:
com.docker.network.bridge.name: "user_network"
com.docker.network.bridge.enable_icc: "false"