-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
108 lines (101 loc) · 2.47 KB
/
docker-compose.yaml
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
---
version: '3.8'
networks:
poga:
x-healthcheck: &healthcheck
interval: 10s
timeout: 3s
retries: 5
start_period: 5s
x-logging: &logging
driver: "json-file"
options:
max-size: 100m
tag: '{{.ImageName}}|{{.Name}}|{{.ImageFullID}}|{{.FullID}}'
services:
parking-service:
image: innoboys/parking-service:0.0.1
# Container name must not have underscores since
# Apache Tomcat cannot work with hostnames that contain underscores
container_name: parking-service
ports:
- "8080:8080"
restart: unless-stopped
healthcheck:
test: [
"CMD-SHELL",
"curl -f http://localhost:8080/health"
]
<<: *healthcheck
logging: *logging
environment:
DB_URL: jdbc:postgresql://parking-postgres:5432/parking-service
DB_USERNAME: postgres
DB_PASSWORD: password
networks:
- poga
postgresql:
image: postgres:12
container_name: parking-postgres
ports:
- "5421:5432"
environment:
- POSTGRES_DB=parking-service
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
logging: *logging
networks:
- poga
deploy:
resources:
limits:
memory: 2g
prometheus:
image: prom/prometheus:v2.47.2
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ${PWD}/config/prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yaml'
- '--web.enable-lifecycle'
- '--storage.tsdb.retention.time=14d'
logging: *logging
healthcheck:
test: [
"CMD-SHELL",
"wget --quiet --spider --timeout=1 http://localhost:9090/-/healthy || exit 1"
]
<<: *healthcheck
networks:
- poga
deploy:
resources:
limits:
memory: 1g
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
environment:
# - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
volumes:
- ${PWD}/config/grafana/provisioning:/etc/grafana/provisioning:ro
- ${PWD}/config/grafana/dashboards:/var/lib/grafana/dashboards
logging: *logging
healthcheck:
test: [
"CMD-SHELL",
"wget --quiet --spider --timeout=1 http://localhost:3000/api/health || exit 1"
]
<<: *healthcheck
networks:
- poga
deploy:
resources:
limits:
memory: 1g