-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
85 lines (81 loc) · 2.12 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
#版本号
version: "3"
#服务
services:
#hgoj服务
hgoj:
#服务器镜像
build:
context: ./hgoj
dockerfile: Dockerfile
# image: registry.cn-zhangjiakou.aliyuncs.com/hgoj/hgoj:v1.1
container_name: hgoj_server
depends_on:
- mysql
restart: always
volumes:
- ${JUDGE_DATA}:/home/judge/data
- ${HGOJ_CONF}/app.conf:/data/www/hgoj/conf/app.conf
- ${HGOJ_LOG}:/data/www/hgoj/logs
# 端口映射。前者是宿主的。后者是容器里端口
ports:
- "8086:8086"
mysql:
build:
context: ./mysql
dockerfile: Dockerfile
container_name: hgoj_mysql
volumes:
- ${DATA_PATH_HOST}/mysql${MYSQL_VERSION}:/var/lib/mysql
- ${LOG_PATH_HOST}/mysql${MYSQL_VERSION}:/var/log/mysql
restart: always
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
judge:
build:
context: ./judge
dockerfile: Dockerfile
# image: registry.cn-zhangjiakou.aliyuncs.com/hgoj/judge:v1
container_name: hgoj_judge
depends_on:
- mysql
volumes:
- ${JUDGE_DATA}:/home/judge/data
- ${JUDGE_CONF}/judge.conf:/home/judge/etc/judge.conf
- ${JUDGE_CONF}/java0.policy:/home/judge/etc/java0.policy
restart: always
nginx:
image: registry.cn-zhangjiakou.aliyuncs.com/hgoj/nginx:v1
# build:
# context: ./nginx
# dockerfile: Dockerfile
container_name: hgoj_nginx
depends_on:
- hgoj
volumes:
- ${APP_PATH_HOST}:${APP_PATH_CONTAINER}
- ${NGINX_SITES_PATH}:/etc/nginx/conf.d
- ${LOG_PATH_HOST}/nginx:/var/log/nginx
ports:
- "80:80"
restart: always
phpmyadmin:
image: registry.cn-zhangjiakou.aliyuncs.com/hgoj/phpmyadmin:v1
container_name: hgoj_phpmyadmin
depends_on:
- mysql
environment:
- PMA_ARBITRARY=1
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
ports:
- "8080:80"
redis:
image: registry.cn-zhangjiakou.aliyuncs.com/hgoj/redis:v1
container_name: hgoj_redis
volumes:
- ${DATA_PATH_HOST}/redis:/data
ports:
- "6379:6379"
restart: always