-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
112 lines (104 loc) · 2.46 KB
/
docker-compose.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
version: '3.8'
networks:
database:
internal:
true
monit:
api:
services:
database-api-cursos:
image: postgres:15.4
container_name: database-api-cursos
restart: unless-stopped
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "postgres", "-U", "root" ]
timeout: 45s
interval: 10s
retries: 10
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=h5UzM2kEnp8Q42
- APP_DB_USER=alura
- APP_DB_PASS=nJ6vsW37rCd1v88
- APP_DB_NAME=logsdb
expose:
- 5432
volumes:
- ./postgres/db:/docker-entrypoint-initdb.d/
- ./postgres/data:/var/lib/postgresql/data
networks:
- database
api-cursos:
build:
context: .
dockerfile: Dockerfile
image: api-cursos
container_name: api-cursos
restart: unless-stopped
ports:
- 80:8080
networks:
- api
- database
- monit
healthcheck:
test: "curl -sS http://api-cursos:8080/actuator/health"
interval: 1s
timeout: 30s
retries: 60
depends_on:
- database-api-cursos
prometheus-api-cursos:
image: prom/prometheus:v2.47.0
user: "root:root"
container_name: prometheus-api-cursos
restart: unless-stopped
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus/prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/etc/prometheus/console_libraries'
- '--web.console.templates=/etc/prometheus/consoles'
- '--web.enable-lifecycle'
ports:
- "9090:9090"
networks:
- monit
- api
grafana-api-cursos:
image: grafana/grafana:9.5.9
user: "root:root"
container_name: grafana-api-cursos
volumes:
- ./grafana:/var/lib/grafana
restart: unless-stopped
ports:
- "3000:3000"
networks:
- monit
depends_on:
- prometheus-api-cursos
loki-api-cursos:
image: grafana/loki:2.9.0
container_name: loki-api-cursos
command:
- -config.file=/etc/loki/local-config.yaml
- -print-config-stderr=true
expose:
- 3100
networks:
- monit
- api
client-api-cursos:
build:
context: ./client/
dockerfile: Dockerfile
image: client-api-cursos
container_name: client-api-cursos
restart: unless-stopped
networks:
- api
depends_on:
- api-cursos