forked from Judge-Girl/Judge-Girl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservices.yml
89 lines (82 loc) · 3.73 KB
/
services.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
version: '3.0'
networks:
default:
external:
name: judge-girl
services:
reverse-proxy:
image: traefik:v2.3
command:
- "--entryPoints.web.address=:80"
- "--api.insecure=true"
- "--providers.docker"
- "--providers.docker.exposedbydefault=false"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
student-service:
build: Spring-Boot/Spring-Boot-Student
environment:
spring.profiles.active: prod,mysql,amqp
logging.level.tw.waterball: TRACE
MYSQL_HOST: "${MYSQL_HOST}"
RABBIT_HOST: "${RABBIT_HOST}"
REDIS_HOST: "${REDIS_HOST}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.student-service.rule=PathPrefix(`/broker`) || PathPrefix(`/api/students`) || PathPrefix(`/api/admins`)"
- "traefik.http.routers.student-service.entrypoints=web"
- "traefik.http.routers.student-service.service=student-service"
- "traefik.http.services.student-service.loadbalancer.server.port=80"
- "traefik.http.routers.student-service.priority=1"
academy-service:
build: Spring-Boot/Spring-Boot-Academy
environment:
spring.profiles.active: prod,amqp,mysql
logging.level.tw.waterball: TRACE
MYSQL_HOST: "${MYSQL_HOST}"
RABBIT_HOST: "${RABBIT_HOST}"
REDIS_HOST: "${REDIS_HOST}"
_JAVA_OPTIONS: "-Djava.net.preferIPv4Stack=true"
labels:
- "traefik.enable=true"
- "traefik.http.routers.academy-service.rule=PathPrefix(`/api/exams`) || PathPrefix(`/api/students/{studentId:[0-9]+}/exams`) || PathPrefix(`/api/students/{studentId:[0-9]+}/homework`) || PathPrefix(`/api/homework`) || PathPrefix(`/api/members`) || PathPrefix(`/api/groups`)"
- "traefik.http.routers.academy-service.entrypoints=web"
- "traefik.http.routers.academy-service.service=academy-service"
- "traefik.http.services.academy-service.loadbalancer.server.port=80"
- "traefik.http.routers.academy-service.priority=3"
problem-service:
build: Spring-Boot/Spring-Boot-Problem
environment:
spring.profiles.active: prod,mongo,redis
logging.level.tw.waterball: TRACE
MONGO_HOST: "${MONGO_HOST}"
REDIS_HOST: "${REDIS_HOST}"
labels:
- "traefik.enable=true"
- "traefik.http.routers.problem-service.rule=PathPrefix(`/api/problems`) || PathPrefix(`/api/plugins`)"
- "traefik.http.routers.problem-service.entrypoints=web"
- "traefik.http.routers.problem-service.service=problem-service"
- "traefik.http.services.problem-service.loadbalancer.server.port=80"
- "traefik.http.routers.problem-service.priority=2"
submission-service:
build: Spring-Boot/Spring-Boot-Submission
environment:
spring.profiles.active: prod,mongo,amqp
logging.level.tw.waterball: TRACE
judge-girl.judger.strategy: docker
MONGO_HOST: "${MONGO_HOST}"
RABBIT_HOST: "${RABBIT_HOST}"
REDIS_HOST: "${REDIS_HOST}"
volumes:
- /var/run/docker.sock:/var/run/docker.sock # docker-in-docker for running judger
command: "/bin/bash -c 'until nc -z -v -w30 ${RABBIT_HOST} 5672; do echo Waiting for RabbitMQ...; sleep 1; done && java -jar /app.jar'"
labels:
- "traefik.enable=true"
- "traefik.http.routers.submission-service.rule=PathPrefix(`/api/submissions`) || PathPrefix(`/api/problems/{problemId:[0-9]+}/{langEnv:\\w+}/students/{studentId:[0-9]+}/submissions`) || PathPrefix(`/api/problems/{problemId:[0-9]+}/samples`)"
- "traefik.http.routers.submission-service.entrypoints=web"
- "traefik.http.routers.submission-service.service=submission-service"
- "traefik.http.services.submission-service.loadbalancer.server.port=80"
- "traefik.http.routers.submission-service.priority=4"