-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
162 lines (158 loc) · 3.93 KB
/
docker-compose.yaml
File metadata and controls
162 lines (158 loc) · 3.93 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
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
services:
# Redis Main Instance (경량화)
redis-main:
image: redis:7.4-alpine
container_name: redis-main
restart: unless-stopped
ports:
- "6379:6379"
volumes:
- ./data/redis-main:/data
- ./config/redis-main.conf:/usr/local/etc/redis/redis.conf:ro
command: >
redis-server /usr/local/etc/redis/redis.conf
--requirepass "${REDIS_PASSWORD}"
networks:
- redis-net
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
healthcheck:
test: ["CMD", "sh", "-c", "redis-cli -a $$REDIS_PASSWORD ping"]
interval: 30s
timeout: 3s
retries: 2
start_period: 10s
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 400M
cpus: '0.4'
reservations:
memory: 200M
cpus: '0.2'
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# Redis Sub Instance (경량화)
redis-sub:
image: redis:7.4-alpine
container_name: redis-sub
restart: unless-stopped
ports:
- "6380:6379"
volumes:
- ./data/redis-sub:/data
- ./config/redis-sub.conf:/usr/local/etc/redis/redis.conf:ro
command: >
redis-server /usr/local/etc/redis/redis.conf
--requirepass "${REDIS_PASSWORD}"
--masterauth "${REDIS_PASSWORD}"
depends_on:
redis-main:
condition: service_healthy
networks:
- redis-net
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD}
healthcheck:
test: ["CMD", "sh", "-c", "redis-cli -a $$REDIS_PASSWORD ping"]
interval: 30s
timeout: 3s
retries: 2
start_period: 10s
security_opt:
- no-new-privileges:true
deploy:
resources:
limits:
memory: 400M
cpus: '0.4'
reservations:
memory: 200M
cpus: '0.2'
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "2"
# Redis Exporter for Main Instance
redis-exporter-main:
image: oliver006/redis_exporter:v1.72.1
container_name: redis-exporter-main
restart: unless-stopped
ports:
- "9121:9121"
environment:
- REDIS_ADDR=redis://redis-main:6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_EXPORTER_LOG_FORMAT=txt
- REDIS_EXPORTER_DEBUG=false
- REDIS_EXPORTER_CHECK_KEYS=""
- REDIS_EXPORTER_CHECK_KEY_GROUPS=""
- REDIS_EXPORTER_INCL_SYSTEM_METRICS=false
- REDIS_EXPORTER_SKIP_TLS_VERIFICATION=true
networks:
- redis-net
depends_on:
redis-main:
condition: service_healthy
security_opt:
- no-new-privileges:true
user: "59000:59000"
deploy:
resources:
limits:
memory: 80M
cpus: '0.15'
reservations:
memory: 50M
cpus: '0.05'
logging:
driver: "json-file"
options:
max-size: "3m"
max-file: "2"
# Redis Exporter for Sub Instance
redis-exporter-sub:
image: oliver006/redis_exporter:v1.72.1
container_name: redis-exporter-sub
restart: unless-stopped
ports:
- "9122:9121"
environment:
- REDIS_ADDR=redis://redis-sub:6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- REDIS_EXPORTER_LOG_FORMAT=txt
- REDIS_EXPORTER_DEBUG=false
- REDIS_EXPORTER_CHECK_KEYS=""
- REDIS_EXPORTER_CHECK_KEY_GROUPS=""
- REDIS_EXPORTER_INCL_SYSTEM_METRICS=false
- REDIS_EXPORTER_SKIP_TLS_VERIFICATION=true
networks:
- redis-net
depends_on:
redis-sub:
condition: service_healthy
security_opt:
- no-new-privileges:true
user: "59000:59000"
deploy:
resources:
limits:
memory: 80M
cpus: '0.15'
reservations:
memory: 50M
cpus: '0.05'
logging:
driver: "json-file"
options:
max-size: "3m"
max-file: "2"
networks:
redis-net:
driver: bridge