-
Notifications
You must be signed in to change notification settings - Fork 3
/
single.yml
117 lines (111 loc) · 2.84 KB
/
single.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
version: '3.5'
services:
ctfd:
build:
context: .
args:
- WORKDIR=/opt/CTFd
image: bitnsc-ctfd-main
user: root
restart: always
ports:
- 80:8000
environment:
- SECRET_KEY=random_this
- UPLOAD_FOLDER=/var/uploads
- DATABASE_URL=mysql+pymysql://ctfd:ctfd@db/ctfd # 格式:mysql+pymysql://<MYSQL_USER>:<MYSQL_PASSWORD>@db/<MYSQL_DATABASE>
- REDIS_URL=redis://cache:6379/0
- WORKERS=4
- LOG_FOLDER=/var/log/CTFd
- ACCESS_LOG=/var/log/CTFd/access.log
- ERROR_LOG=/var/log/CTFd/error.log
- PROBLEM_DOCKER_RUN_FOLDER=/home/docker # 题目容器运行的文件夹,保证与下方 volumes 中的一致
volumes:
- .data/CTFd/logs:/var/log/CTFd
- .data/CTFd/uploads:/var/uploads
- .:/opt/CTFd
- /home/docker:/home/docker # 宿主机和容器的映射目录和 PROBLEM_DOCKER_RUN_FOLDER 一致,保证题目创建时不会出现找不到题目容器的映射目录等情况
- /var/run/docker.sock:/var/run/docker.sock # 保证通过容器的 docker.sock 能操作宿主机的 docker.sock
depends_on:
- db
- frpc
networks:
default:
internal:
frp:
ipv4_address: 10.1.0.5
db:
image: mariadb:10.4
restart: always
environment:
- MYSQL_ROOT_PASSWORD=ctfd
- MYSQL_USER=ctfd
- MYSQL_PASSWORD=ctfd
- MYSQL_DATABASE=ctfd
volumes:
- .data/mysql:/var/lib/mysql
networks:
internal:
# 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]
cache:
image: redis:4
restart: always
volumes:
- .data/redis:/data
networks:
internal:
frps:
image: spaceskynet/bitnsc-frp
# you can build image by yourself if you want.
#build: ./frp
restart: always
volumes:
- ./frp/conf:/conf/
expose:
- 80
ports:
- 20000-20099:20000-20099
entrypoint:
- /app/frps
- -c
- /conf/frps.ini
networks:
default:
frp:
ipv4_address: 10.1.0.3
frpc:
image: spaceskynet/bitnsc-frp
# you can build image by yourself if you want.
#build: ./frp
restart: always
volumes:
- ./frp/conf:/conf/
expose:
- 7400
entrypoint:
- /app/frpc
- -c
- /conf/frpc.ini
networks:
frp:
ipv4_address: 10.1.0.4
frp_containers:
networks:
default:
name: "bitnsc_default"
internal:
name: "bitnsc_internal"
internal: true
frp:
name: "bitnsc_frp"
driver: bridge
ipam:
config:
- subnet: 10.1.0.0/16
frp_containers:
name: "bitnsc_frp_containers"
driver: bridge
ipam:
config:
- subnet: 10.2.0.0/16