-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
92 lines (86 loc) · 1.95 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
version: '4.3'
services:
# Container da aplicação Spring Boot
spring-app:
build: .
ports:
- "8080:8080"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_completed_successfully
prometheus:
condition: service_completed_successfully
grafana:
condition: service_completed_successfully
environment:
- JWT_SECRET=${JWT_SECRET}
- SERVER_URL=${SERVER_URL}
- SPRING_DATASOURCE_URL=jdbc:mysql://mysql:3306/movies_dev
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=ismael
- SPRING_REDIS_HOST=redis
- SPRING_REDIS_PORT=6379
networks:
- app-network
deploy:
resources:
limits:
cpus: '4.0'
memory: '2048M'
# Redis
redis:
image: redis:7.0
container_name: redis
ports:
- "6379:6379"
networks:
- app-network
deploy:
resources:
limits:
cpus: '2.0'
memory: '1024M'
# Prometheus
prometheus:
image: prom/prometheus:v2.44.0
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- app-network
# Grafana
grafana:
image: grafana/grafana:9.5.2
container_name: grafana
ports:
- "3000:3000"
restart: unless-stopped
volumes:
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
networks:
- app-network
mysql:
image: mysql:8.0
container_name: mysql
environment:
MYSQL_ROOT_PASSWORD: ismael
MYSQL_DATABASE: movies_dev
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 30s
timeout: 10s
retries: 5
networks:
- app-network
deploy:
resources:
limits:
cpus: '1.0'
memory: '1024M'
networks:
app-network:
driver: bridge