-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
123 lines (109 loc) · 3.09 KB
/
docker-compose.yml
File metadata and controls
123 lines (109 loc) · 3.09 KB
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
networks:
distributed_scheduler:
driver: bridge
services:
# --------------------------------------------------------------
# Eureka Server
# --------------------------------------------------------------
eureka:
build: ./infra/eureka
container_name: eureka_client_discovery
ports:
- "8761:8761"
networks:
- distributed_scheduler
environment:
- SPRING_PROFILES_ACTIVE=docker
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8761/actuator/health"]
interval: 10s
timeout: 5s
retries: 5
# --------------------------------------------------------------
# Scheduler Instance
# --------------------------------------------------------------
scheduler-instance:
build: ./scheduler-instance
ports:
- "8081"
networks:
- distributed_scheduler
environment:
- SPRING_PROFILES_ACTIVE=docker
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=http://eureka:8761/eureka/
depends_on:
eureka:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8081/actuator/health"]
interval: 10s
timeout: 5s
retries: 5
# --------------------------------------------------------------
# NGINX Load Balancer
# --------------------------------------------------------------
nginx:
build: ./infra/nginx
container_name: nginx_load_balancer
ports:
- "80:80"
networks:
- distributed_scheduler
volumes:
- ./infra/nginx/conf.d:/etc/nginx/conf.d
depends_on:
eureka:
condition: service_healthy
# --------------------------------------------------------------
# Eureka → NGINX Reconciler
# --------------------------------------------------------------
eureka2nginx:
build: ./infra/eureka2nginx
container_name: eureka_to_nginx_reconciler
environment:
- EUREKA_SERVER_URL=http://eureka:8761/eureka/apps/
- POLL_INTERVAL=10
volumes:
- ./infra/nginx/conf.d:/etc/nginx/conf.d
depends_on:
- nginx
- eureka
networks:
- distributed_scheduler
# --------------------------------------------------------------
# Postgres Database for Quartz
# --------------------------------------------------------------
postgres:
image: postgres:14.7
container_name: quartz_postgres
restart: always
environment:
POSTGRES_USER: scheduler
POSTGRES_PASSWORD: scheduler
POSTGRES_DB: scheduler
ports:
- "5432:5432"
volumes:
- quartz_pgdata:/var/lib/postgresql/data
networks:
- distributed_scheduler
# --------------------------------------------------------------
# UI for Scheduler
# --------------------------------------------------------------
ui:
build:
context: ./distributed-scheduler-ui
args:
- VITE_API_BASE_URL=/api/graphql
container_name: scheduler_ui
ports:
- "8080:80"
networks:
- distributed_scheduler
environment:
- VITE_API_BASE_URL=/api/graphql
depends_on:
- nginx
- scheduler-instance
volumes:
quartz_pgdata: