This commit is contained in:
virusdefender 2017-06-11 16:12:35 +08:00
parent 5fb7f2cafe
commit 65fe5dbda7
3 changed files with 43 additions and 5 deletions

11
README.md Normal file
View File

@ -0,0 +1,11 @@
这是一个新的部署脚本,应该会非常方便了。之前的部署很多不科学的地方,大家可以测试下。
安装完 docker 和 docker-compose 之后,修改 docker-compose.yml 第28行为自定义的密码比如`rpc_token=123456`。
然后 `docker-compose up -d` ,不需要其他的步骤,大约一分钟之后 web 界面就可以访问了默认开放80和443端口。其中443端口是自签名证书。
超级管理员用户名是root默认密码是`password@root`,请及时修改。
登录`/admin`添加一个判题服务器地址为judger端口为8080密码是上面自定义的`rpc_token`。
修改`custom_settings.py`可以自定义站点信息。

21
custom_settings.py Normal file
View File

@ -0,0 +1,21 @@
# coding=utf-8
import os
WEBSITE_INFO = {"website_name": u"example1大学 OnlineJudge",
"website_name_shortcut": u"example oj",
"website_footer": u"example大学foobar学院 <a href=\"http://www.miibeian.gov.cn/\">京ICP备233333号-1</a>",
# url结尾没有/
"url": u"http://your-domain-or-ip.com"}
# https://github.com/QingdaoU/OnlineJudge/wiki/SMTP
SMTP_CONFIG = {"smtp_server": "smtp.domain.com",
"email": "noreply@domain.com",
"password": "your_password",
"port": 25,
"tls": True}
# 是否显示所有人的提交, False就只显示自己的
SHOW_ALL_SUBMISSIONS_LIST = False

View File

@ -2,20 +2,23 @@ version: "2"
services:
oj_redis:
image: redis:3.0-alpine
container_name: oj_redis
restart: always
volumes:
- $PWD/data/redis:/data
oj_mysql:
image: registry.cn-hangzhou.aliyuncs.com/qduoj/mysql
container_name: oj_mysql
restart: always
volumes:
- $PWD/data/mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD={YOUR_PASSWORD}
- MYSQL_ROOT_PASSWORD=MYSQL_PASSWORD_AAA
judger:
image: registry.cn-hangzhou.aliyuncs.com/qduoj/judger
container_name: judger
restart: always
volumes:
- $PWD/data/test_case:/var/judger/test_case
@ -23,10 +26,10 @@ services:
environment:
- TZ=Asia/Shanghai
- rpc_token={YOUR_PASSWORD}
ports:
- "9000:8080"
oj_web_server:
image: registry.cn-hangzhou.aliyuncs.com/qduoj/oj_web_server
container_name: oj_web_server
restart: always
links:
- oj_mysql
@ -36,10 +39,13 @@ services:
- $PWD/data/test_case:/code/test_case
- $PWD/data/upload:/code/upload
- $PWD/data/log:/code/log
- $PWD/data/ssl:/code/ssl
- $PWD/custom_settings.py:/code/oj/custom_settings.py
environment:
- TZ=Asia/Shanghai
- oj_env=server
- MYSQL_ENV_MYSQL_USER=root
- MYSQL_ENV_MYSQL_ROOT_PASSWORD={YOUR_PASSWORD}
- MYSQL_ENV_MYSQL_ROOT_PASSWORD=MYSQL_PASSWORD_AAA
ports:
- "0.0.0.0:80:8001"
- "0.0.0.0:80:80"
- "0.0.0.0:443:443"