Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
127 lines (121 loc) · 3.45 KB
/
Copy pathdocker-compose.yml
File metadata and controls
127 lines (121 loc) · 3.45 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
124
125
126
127
services:
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: jobscheduler
POSTGRES_USER: jobscheduler
POSTGRES_PASSWORD: jobscheduler
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U jobscheduler -d jobscheduler"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "6379:6379"
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 10
zookeeper:
image: confluentinc/cp-zookeeper:7.7.1
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- "2181:2181"
volumes:
- zookeeper-data:/var/lib/zookeeper/data
- zookeeper-log:/var/lib/zookeeper/log
healthcheck:
test: ["CMD-SHELL", "cub zk-ready localhost 2181"]
interval: 10s
timeout: 5s
retries: 10
kafka:
image: confluentinc/cp-kafka:7.7.1
depends_on:
zookeeper:
condition: service_healthy
ports:
- "9092:9092"
- "29092:29092"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,PLAINTEXT_HOST://0.0.0.0:29092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
volumes:
- kafka-data:/var/lib/kafka/data
healthcheck:
test: ["CMD-SHELL", "kafka-broker-api-versions --bootstrap-server localhost:9092 >/dev/null 2>&1"]
interval: 15s
timeout: 10s
retries: 10
app:
build:
context: ./backend
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
environment:
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/jobscheduler
SPRING_DATASOURCE_USERNAME: jobscheduler
SPRING_DATASOURCE_PASSWORD: jobscheduler
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka:9092
SPRING_REDIS_HOST: redis
SPRING_REDIS_PORT: 6379
APP_JWT_SECRET: change-me-change-me-change-me-change-me
APP_DEV_TOKEN_ENABLED: "true"
DB_POOL_MAX: 30
APP_LEASE_BATCH_SIZE: 100
APP_OUTBOX_BATCH_SIZE: 1000
APP_OUTBOX_RELAY_DELAY_MS: 200
APP_RATE_LIMIT_CAPACITY: 200000
APP_RATE_LIMIT_REFILL_PER_MINUTE: 200000
MANAGEMENT_TRACING_SAMPLING_PROBABILITY: 0.0
ports:
- "8080:8080"
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:8080/actuator/health/readiness || exit 1"]
interval: 15s
timeout: 5s
retries: 20
frontend:
build:
context: ./frontend
depends_on:
app:
condition: service_healthy
ports:
- "3000:80"
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://127.0.0.1/health >/dev/null 2>&1 || exit 1"]
interval: 15s
timeout: 5s
retries: 10
volumes:
postgres-data:
redis-data:
zookeeper-data:
zookeeper-log:
kafka-data: