forked from Linzecong/LPOJ
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
193 lines (179 loc) · 5.21 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
version: '2'
services:
db:
image: ccr.ccs.tencentyun.com/lpoj/database
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: "lpojdatabase" # 选择性修改,如果你有自己的数据库,请忽略
ports:
- "3306:3306"
restart: always
volumes:
- "./Database/data:/var/lib/mysql"
- "./Database/conf:/etc/mysql/mysql.conf.d"
backend1:
image: ccr.ccs.tencentyun.com/lpoj/backend
depends_on:
- db
command: >
/bin/bash -c '
sleep 40 ;
python manage.py makemigrations &&
python manage.py makemigrations judgestatus item problem user contest board blog wiki &&
python manage.py migrate &&
echo "from django.contrib.auth.models import User; User.objects.filter(email=\"admin@example.com\").delete(); User.objects.create_superuser(\"admin\", \"admin@example.com\", \"admin\")" | python manage.py shell &&
gunicorn -w 5 --bind 0.0.0.0:8000 -k 'gevent' Backend.wsgi:application
'
links:
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306 # 选择性修改
ports:
- "8000:8000"
restart: always
volumes:
- "./Backend:/Backend"
backend2:
image: ccr.ccs.tencentyun.com/lpoj/backend
depends_on:
- backend1
command: >
/bin/bash -c '
sleep 70 ;
gunicorn -w 5 --bind 0.0.0.0:8000 -k 'gevent' Backend.wsgi:application
'
links:
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306 # 选择性修改
ports:
- "8001:8000"
restart: always
volumes:
- "./Backend:/Backend"
backend3:
image: ccr.ccs.tencentyun.com/lpoj/backend
depends_on:
- backend1
command: >
/bin/bash -c '
sleep 70 ;
gunicorn -w 5 --bind 0.0.0.0:8000 -k 'gevent' Backend.wsgi:application
'
links:
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306 # 选择性修改
ports:
- "8002:8000"
restart: always
volumes:
- "./Backend:/Backend"
frontend:
image: ccr.ccs.tencentyun.com/lpoj/frontend
depends_on:
- backend3
command: >
/bin/bash -c '
sleep 80 ;
nginx -g "daemon off;"
'
links:
- backend1:lpojbackend1
- backend2:lpojbackend2
- backend3:lpojbackend3
ports:
- "8080:80"
restart: always
volumes:
- "./Frontend/dist/img:/Frontend/dist/img"
frontendmobile:
image: ccr.ccs.tencentyun.com/lpoj/frontendmobile
depends_on:
- backend3
command: >
/bin/bash -c '
sleep 80 ;
nginx -g "daemon off;"
'
links:
- backend1:lpojbackend1
- backend2:lpojbackend2
- backend3:lpojbackend3
ports:
- "8081:8081"
restart: always
volumes:
- "./FrontendMobile/dist/img:/FrontendMobile/dist/img"
judgerserver:
image: ccr.ccs.tencentyun.com/lpoj/judgerserver
depends_on:
- db
command: >
/bin/bash -c '
sleep 60 ;
python main.py
'
links:
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306 # 选择性修改
ports:
- "9906:9906"
restart: always
crawlingserver:
image: ccr.ccs.tencentyun.com/lpoj/crawlingserver
depends_on:
- backend3
command: >
/bin/bash -c '
sleep 60 ;
python main.py
'
links:
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306 # 选择性修改
restart: always
judger:
image: ccr.ccs.tencentyun.com/lpoj/judger
depends_on:
- judgerserver
command: >
/bin/bash -c '
sleep 65 ;
python3 main.py
'
links:
- judgerserver:lpojjudgerserver
- db:lpojdatabase
environment:
DB_PASSWORD: "lpojdatabase" # 选择性修改
DB_HOST: "lpojdatabase" # 选择性修改
DB_USER: 'root' # 选择性修改
DB_PORT: 3306
SERVER_IP: "lpojjudgerserver"
SFTP_PORT: 22
SFTP_IP: "172.17.0.1" # 必须修改,不能写127.0.0.1或localhost,必须写你的局域网地址或者公网地址
SFTP_USER: 'ubuntu' # 必须修改
SFTP_PASSWORD: 'ubuntuubuntu' # 必须修改
BACKEND_PATH: "/home/ubuntu/LPOJ/Backend/" # 必须修改
NO_DOWNLOAD: "no" # 设为yes,则不使用sftp,需要手动将数据压缩包放到Judger/ProblemData中
restart: always
volumes:
- "./Judger/ProblemData:/Judger/ProblemData"