-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
106 lines (100 loc) · 2.49 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
services:
postgresql:
image: postgres:latest
container_name: postgresql
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: ${DB_NAME}
PGDATA: /data/postgres
TZ: Asia/Tehran
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${DB_NAME} -U ${DB_USER}"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgresql:/data/postgres
ports:
- "5432:5432"
restart: unless-stopped
networks:
- monitoring
# go-app:
# build:
# context: .
# dockerfile: Dockerfile
# ports:
# - "5000:8080"
# environment:
# DB_HOST: ${DB_HOST}
# DB_PORT: ${DB_PORT}
# DB_USER: ${DB_USER}
# DB_PASSWORD: ${DB_PASS}
# DB_NAME: ${DB_NAME}
# DISPLAY: "host.docker.internal:0"
# volumes:
# - /tmp/.X11-unix:/tmp/.X11-unix
# depends_on:
# - postgresql
# networks:
# - go-post
# - x11-network
prometheus:
image: prom/prometheus
container_name: prometheus
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- "${PROMETHEUS_PORT:-9090}:9090"
restart: unless-stopped
networks:
- monitoring
postgresql-exporter:
image: prometheuscommunity/postgres-exporter
container_name: postgresql-exporter
ports:
- "9187:9187"
environment:
# DATA_SOURCE_NAME: "postgres://:@$"
- DATA_SOURCE_URI=${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable
- DATA_SOURCE_USER=${DB_USER}
- DATA_SOURCE_PASS=${DB_PASS}
depends_on:
postgresql:
condition: service_healthy
prometheus:
condition: service_started
restart: unless-stopped
networks:
- monitoring
grafana:
image: grafana/grafana
container_name: grafana
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
GF_USERS_ALLOW_SIGN_UP: false
volumes:
- grafana:/var/lib/grafana
ports:
- "${GRAFANA_PORT:-3000}:3000"
restart: unless-stopped
networks:
- monitoring
volumes:
prometheus:
grafana:
postgresql:
networks:
monitoring:
driver: bridge
go-post:
driver: bridge
x11-network:
driver: bridge