-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
81 lines (77 loc) · 1.99 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
version: '3.9'
services:
# Сервис для разворачивания контейнера с базой данных
postgres:
container_name: postgres
image: postgres:12
hostname: database
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "5430:5432"
networks:
- monitoring
# Сервис для разворачивания контейнера с приложением
webapi:
build:
dockerfile: Dockerfile
context: .
hostname: webapi
ports:
- "8080:8080"
depends_on:
- postgres
environment:
- HOST=postgres
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PORT=${POSTGRES_PORT}
- DDL_AUTO=${DDL_AUTO}
- JWT_SECRET=${JWT_SECRET}
- JWT_ACCESS=${JWT_ACCESS}
- JWT_REFRESH=${JWT_REFRESH}
healthcheck:
test: curl http://localhost:8080 || exit 0
interval: 10s
retries: 5
start_period: 15s
timeout: 10s
networks:
- monitoring
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- "9090:9090"
healthcheck:
test: curl http://localhost:9090 || exit 0
interval: 10s
retries: 5
timeout: 5s
networks:
- monitoring
grafana:
image: grafana/grafana
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
- ./grafana/dashboards:/var/lib/grafana/dashboards
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
- DS_PROMETHEUS=prometheus
- PROMETHEUS_URL=http://prometheus:9090
ports:
- "3000:3000"
depends_on:
- prometheus
networks:
- monitoring
networks:
monitoring:
driver: bridge