-
Notifications
You must be signed in to change notification settings - Fork 1
/
single-node-docker-compose.yml
125 lines (119 loc) · 3.18 KB
/
single-node-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
version: '3'
services:
judger:
image: registry.cn-hangzhou.aliyuncs.com/onlinejudge/judge_server
container_name: shuoj-judger
read_only: true
cap_drop:
- SETPCAP
- MKNOD
- NET_BIND_SERVICE
- SYS_CHROOT
- SETFCAP
- FSETID
tmpfs:
- /tmp
volumes:
- ./backend/upload/problems:/test_case:ro
- ./judger/log:/log
# - $PWD/server:/code:ro
- ./judger/run:/judger
environment:
- BACKEND_URL=http://shuoj-backend:8081/api/v1/judge_server_heartbeat
- SERVICE_URL=http://shuoj-judger:8080
- TOKEN=acmOJ_shu
ports:
- '0.0.0.0:12358:8080'
networks:
- webnet
mysql:
image: mysql:5
container_name: mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always
environment:
MYSQL_ROOT_PASSWORD: passmysql
ports:
- '3306:3306'
volumes:
- './mysql/db:/var/lib/mysql'
- './mysql/conf:/etc/mysql/conf.d'
- './init/mysql:/docker-entrypoint-initdb.d'
networks:
- webnet
redis:
image: redis:latest
container_name: redis
command: redis-server --requirepass passredis
ports:
- '6379:6379'
volumes:
- './redis/data:/data'
networks:
- webnet
zookeeper:
container_name: zookeeper
image: wurstmeister/zookeeper
ports:
- '2181:2181'
networks:
- kafkanet
kafka:
container_name: kafka
image: wurstmeister/kafka:2.12-2.2.0
ports:
- '9092:9092'
environment:
KAFKA_ADVERTISED_HOST_NAME: ${LOCAL_HOST}
KAFKA_CREATE_TOPICS: 'submission:1:1,auth:1:1'
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- kafkanet
backend:
image: registry.cn-hangzhou.aliyuncs.com/kastnerorz/shu-online-judge:v1.1.0
container_name: shuoj-backend
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/oj?characterEncoding=utf8&serverTimezone=UTC&useSSL=false
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=passmysql
- SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE=30MB
- SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE=100MB
# - SERVER_PORT=8081
- UPLOAD_PATH=/var/lib/upload
- KAFKA_PRODUCER_BOOTSTRAPSERVERS=${LOCAL_HOST}:9092
- KAFKA_CONSUMER_BOOTSTRAPSERVERS=${LOCAL_HOST}:9092
- KAFKA_TOPIC_SUBMISSION=submission
- KAFKA_TOPIC_AUTH=auth
- SPRING_REDIS_HOST=redis
- SPRING_REDIS_PORT=6379
- JWT_SECRET=acmOJ_shu
- JUDGER_TOKEN=50f155d68905eb9fc33a23dd821204167eba0fdaf8197abbf75f8edf60ccae98
- JUDGER_URL=http://shuoj-judger:8080
ports:
- 8081:8081
volumes:
- ./backend/upload:/var/lib/upload
networks:
- webnet
depends_on:
- redis
- mysql
- kafka
- zookeeper
frontend:
build:
context: ./shu-online-judge-fe
args:
- VUE_APP_BASE_URL=http://${LOCAL_HOST}:8081
environment:
- PORT=8080
container_name: shuoj-frontend
ports:
- '8080:8080'
networks:
- webnet
networks:
webnet:
kafkanet: