forked from NikolayIT/OpenJudgeSystem
-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yml
180 lines (175 loc) · 3.82 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
version: '3.8'
services:
ui:
build:
context: .
dockerfile: ./Docker/Dockerfile.ui
image: judge_web_ui
container_name: web_ui_instance
ports:
- "5010:80"
restart: on-failure
volumes:
- ./Logs:/Logs
env_file:
- Docker/envs/common.env
extra_hosts:
- "db:host-gateway"
links:
- loki
- mq
- redis
depends_on:
- mq
- redis
fe:
build:
context: .
dockerfile: ./Docker/Dockerfile.fe
args:
- YARN_BUILD_COMMAND=build:local
image: judge_web_fe
container_name: web_fe_instance
ports:
- "5002:80"
restart: on-failure
volumes:
- ./Logs:/Logs
- .:/app
- /app/node_modules
links:
- ui
depends_on:
- ui
administration:
build:
context: .
dockerfile: ./Docker/Dockerfile.administration
image: judge_administration
container_name: administration_instance
ports:
- "5001:80"
restart: on-failure
volumes:
- ./Logs:/Logs
env_file:
- Docker/envs/common.env
extra_hosts:
- "db:host-gateway"
links:
- loki
- mq
- redis
depends_on:
- mq
- redis
worker:
build:
context: .
dockerfile: ./Docker/Dockerfile.worker
image: judge_worker
ports:
- "8003:80"
container_name: worker_instance
restart: on-failure
env_file:
- Docker/envs/common.env
- Docker/envs/worker.env
volumes:
- ./Logs:/Logs
- /tmp/ExecutionStrategies:/tmp/ExecutionStrategies
- /var/run/docker.sock:/var/run/docker.sock
links:
- loki
- mq
- sql_server
- mysql
- postgres
depends_on:
- mq
- sql_server
- mysql
- postgres
extra_hosts:
- "host.docker.internal:host-gateway"
# External services
mq:
image: rabbitmq:3.12-management
ports:
- "5672:5672"
- "15672:15672"
container_name: mq_instance
hostname: "judge-mq"
environment:
DEFAULT_USER_PASSWORD: myS3cretPass2
volumes:
- rabbitmq_data:/var/lib/rabbitmq/mnesia
- ./rabbitmq/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf:ro
redis:
image: "redis:7"
ports:
- "6379:6379"
container_name: redis_instance
hostname: "judge-rd"
command: "redis-server --requirepass redisPass123"
## Worker dependencies
sql_server:
image: mcr.microsoft.com/mssql/server:2017-CU8-ubuntu
restart: always
environment:
ACCEPT_EULA: Y
SA_PASSWORD: 1123QwER
mysql:
image: mysql/mysql-server:8.0.19
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 1123QwER
MYSQL_ROOT_HOST: '%'
postgres:
image: postgres:15
restart: always
environment:
POSTGRES_PASSWORD: 1123QwER
POSTGRES_USER: postgres
# Monitoring
loki:
image: grafana/loki:3.1.0
ports:
- "3100:3100"
command: -config.file=/etc/loki/local-config.yaml
volumes:
- loki_data:/loki
grafana:
image: grafana/grafana:latest
ports:
- "3000:3000"
environment:
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
entrypoint:
- sh
- -euc
- |
mkdir -p /etc/grafana/provisioning/datasources
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
apiVersion: 1
datasources:
- name: Loki
type: loki
access: proxy
orgId: 1
url: http://loki:3100
basicAuth: false
isDefault: true
version: 1
editable: false
EOF
/run.sh
volumes:
- grafana_data:/var/lib/grafana
volumes:
rabbitmq_data:
loki_data:
grafana_data: