-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
99 lines (91 loc) · 2.43 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
version: "3"
volumes:
static_volume: null
media_volume: null
build_folder: null
prometheus_data: null
grafana_data: null
services:
backend:
build: ./letterman-back/backend
container_name: backend
command: >
bash -c "python3 manage.py makemigrations letters &&
python3 manage.py makemigrations users &&
python3 manage.py migrate &&
gunicorn backend.wsgi --bind 0.0.0.0:8080 --timeout 240"
ports:
- "8080:8080"
volumes:
- ./letterman-back/backend:/app
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
# networks:
# - letterman
frontend:
build:
context: ./letterman-front
args:
API_URL: "*"
container_name: frontend
volumes:
- ./letterman-front:/frontend
- build_folder:/frontend/build
- ./letterman-front/node_modules/:/frontend/node_modules
restart: always
stdin_open: true
tty: true
# networks:
# - letterman
nginx:
build:
context: ./nginx
# image: nginx:latest
container_name: nginx
volumes:
- static_volume:/backend/staticfiles
- media_volume:/backend/mediafiles
- build_folder:/var/www/frontend
ports:
- 80:80
depends_on:
- backend
- frontend
# networks:
# - letterman
prometheus:
container_name: prometheus
image: prom/prometheus
restart: unless-stopped
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus:/prometheus
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=90d # 90일보다 오래된 metrics는 삭제
- --storage.tsdb.retention.size=10GB # 10GB를 넘을 시 오래된 metrics 삭제
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/proemtheus/consoles
- --web.enable-admin-api
# networks:
# - letterman
grafana:
container_name: grafana
image: grafana/grafana
restart: unless-stopped
ports:
- 3030:3030
volumes:
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
environment:
GF_INSTALL_PLUGINS: "grafana-clock-panel,grafana-simple-json-datasource"
depends_on:
- prometheus
# networks:
# - letterman
# networks:
# letterman:
# driver: bridge