-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
118 lines (108 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
113
114
115
116
117
118
version: "3" # version of docker-compose we want to use
services:
# ––––– Application –––––
# ––––––––––––––––––––––
client:
# build represents where to find docker file (i.e. /app folder)
container_name: client
build: app
volumes:
- ./app/src/:/app/src
env_file:
- .env
# ports:
# - 3000:3000
depends_on:
- api
networks:
- nginx_client
api:
container_name: flask-api
volumes:
- ./api:/api
# ports:
# - 5000:5000
# build represents where to find docker file (i.e. /api folder)
build: api
restart: always
# pass environment variables from docker environment
env_file:
- .env
depends_on:
- db
networks:
- nginx_api
- api_db
db:
container_name: postgres-db
image: postgres:latest
restart: always
# Add persistence to postgres
volumes:
- db:/var/lib/postgresql/data
env_file:
- .env
networks:
- api_db
# ––––– Monitoring –––––
# ––––––––––––––––––––––
grafana:
container_name: grafana
image: grafana/grafana:latest
restart: unless-stopped
environment:
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/grafana/
ports:
- 3000:3000
depends_on:
- prometheus
networks:
- monitoring
volumes:
- grafana_storage:/var/lib/grafana
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- cadvisor
networks:
- monitoring
cadvisor:
image: gcr.io/cadvisor/cadvisor:latest
container_name: cadvisor
ports:
- 8081:8080
volumes:
- /:/roots:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
networks:
- monitoring
# –––– Nginx ––––
nginx:
container_name: nginx
image: nginx:alpine
restart: always
ports:
- 80:80
volumes:
- ./nginx/nginx-conf-dev.conf:/etc/nginx/conf.d/default.conf:ro
networks:
- nginx_client
- nginx_api
- monitoring
volumes:
db:
grafana_storage:
networks:
api_db:
nginx_client:
nginx_api:
monitoring: