-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
106 lines (94 loc) · 2.04 KB
/
docker-compose.prod.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
version: "3"
#-----Application-----
services:
frontend:
container_name: react
build:
context: frontend
dockerfile: Dockerfile.prod
restart: always
depends_on:
- backend
networks:
- nginx_frontend_network
backend:
container_name: backend
build: backend
restart: always
environment:
- FLASK_ENV=development
env_file:
- ./backend/.env
depends_on:
- db
networks:
- nginx_backend_network
- backend_network
db:
container_name: mhaDb
image: postgres
restart: always
env_file:
- ./backend/.env
volumes:
- userdatabase:/var/lib/postgresql/data
networks:
- backend_network
#-----Proxy-----
nginx:
container_name: nginx
image: jonasal/nginx-certbot:latest
restart: unless-stopped
env_file:
- ./nginx-certbot.env
ports:
- "80:80"
- "443:443"
volumes:
- nginx_secrets:/etc/letsencrypt
- ./nginx/nginx.conf:/etc/nginx/user_conf.d/default.conf:ro
networks:
- nginx_frontend_network
- nginx_backend_network
#-----Monitoring-----
cadvisor:
container_name: cadvisor
image: gcr.io/cadvisor/cadvisor:latest
restart: unless-stopped
ports:
- 8080:8080
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
prometheus:
container_name: prometheus
image: prom/prometheus:latest
restart: unless-stopped
ports:
- 9090:9090
command:
- --config.file=/etc/prometheus/prometheus.yml
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
depends_on:
- cadvisor
grafana:
container_name: grafana
image: grafana/grafana:latest
restart: unless-stopped
ports:
- 3000:3000
volumes:
- grafana_storage:/var/lib/grafana
depends_on:
- prometheus
volumes:
userdatabase:
nginx_secrets:
grafana_storage:
networks:
nginx_frontend_network:
nginx_backend_network:
backend_network: