Skip to content

Commit 42e5861

Browse files
committed
fix: grafana, prometheus permit
init을 통해 directory 생성 및 권한 부여
1 parent 2706fe1 commit 42e5861

1 file changed

Lines changed: 60 additions & 15 deletions

File tree

docker-compose-server.yml

Lines changed: 60 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -187,36 +187,81 @@ services:
187187
depends_on:
188188
- kafka
189189

190+
# grafana:
191+
# image: grafana/grafana:latest
192+
# container_name: grafana
193+
# ports:
194+
# - "3000:3000"
195+
# volumes:
196+
# - ./grafana/data:/var/lib/grafana
197+
# - ./grafana/provisioning:/etc/grafana/provisioning
198+
# environment:
199+
# - GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
200+
# - GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
201+
# user: "472"
202+
# depends_on:
203+
# - prometheus
204+
#
205+
# prometheus:
206+
# image: prom/prometheus:latest
207+
# container_name: prometheus
208+
# ports:
209+
# - "9090:9090"
210+
# volumes:
211+
# - ./prometheus.yml:/etc/prometheus/prometheus.yml
212+
# - ./prometheus/data:/prometheus
213+
# user: "472"
214+
# command:
215+
# - '--config.file=/etc/prometheus/prometheus.yml'
216+
217+
prometheus-init:
218+
image: alpine
219+
container_name: prometheus-init
220+
command: ["sh", "-c", "mkdir -p /prometheus/data && chown -R 65534:65534 /prometheus"]
221+
volumes:
222+
- prometheus_data:/prometheus
223+
restart: "no"
224+
225+
prometheus:
226+
image: prom/prometheus:latest
227+
container_name: prometheus
228+
ports:
229+
- "9090:9090"
230+
volumes:
231+
- ./prometheus.yml:/etc/prometheus/prometheus.yml
232+
- prometheus_data:/prometheus
233+
command:
234+
- '--config.file=/etc/prometheus/prometheus.yml'
235+
depends_on:
236+
- prometheus-init
237+
238+
grafana-init:
239+
image: alpine
240+
container_name: grafana-init
241+
command: ["sh", "-c", "chown -R 472:472 /var/lib/grafana"]
242+
volumes:
243+
- grafana-storage:/var/lib/grafana
244+
restart: "no"
245+
190246
grafana:
191247
image: grafana/grafana:latest
192248
container_name: grafana
193249
ports:
194250
- "3000:3000"
195251
volumes:
196-
- ./grafana/data:/var/lib/grafana
252+
- grafana-storage:/var/lib/grafana
197253
- ./grafana/provisioning:/etc/grafana/provisioning
198254
environment:
199255
- GF_SECURITY_ADMIN_USER=${GF_SECURITY_ADMIN_USER}
200256
- GF_SECURITY_ADMIN_PASSWORD=${GF_SECURITY_ADMIN_PASSWORD}
201-
user: "472"
202257
depends_on:
258+
- grafana-init
203259
- prometheus
204260

205-
prometheus:
206-
image: prom/prometheus:latest
207-
container_name: prometheus
208-
ports:
209-
- "9090:9090"
210-
volumes:
211-
- ./prometheus.yml:/etc/prometheus/prometheus.yml
212-
- ./prometheus/data:/prometheus
213-
command:
214-
- '--config.file=/etc/prometheus/prometheus.yml'
215-
216261
volumes:
217262
user-postgres-data:
218263
reservation-postgres-data:
219264
flight-postgres-data:
220265
payments-postgres-data:
221-
# prometheus_data:
222-
# grafana-storage:
266+
prometheus_data:
267+
grafana-storage:

0 commit comments

Comments
 (0)