-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
213 lines (196 loc) · 5.21 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
version: "3"
services:
db:
image: postgres
container_name: db_n
volumes:
- ./data/db:/var/lib/postgresql/data/
ports:
- 5432:5432
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
networks:
- t4y
backend:
container_name: backend_n
build: ./backend
command: sh -c "python manage.py makemigrations account && \
python manage.py makemigrations subscribe && \
python manage.py makemigrations summary && \
python manage.py migrate && python manage.py loaddata test.json && \
python manage.py runserver 0.0.0.0:8000"
ports:
- 8000:8000
volumes:
- ./backend:/usr/src/app
env_file:
- .env
depends_on:
- db
networks:
- t4y
rabbit:
container_name: rabbit_n
image: rabbitmq:3-management
hostname: rabbit
environment:
- RABBITMQ_DEFAULT_USER=admin
- RABBITMQ_DEFAULT_PASS=mypass
ports:
- "15672:15672"
- "5672:5672"
networks:
- t4y
celery:
container_name: celery_n
build: ./backend
command: sh -c 'celery -A nTeamProject.celery worker --loglevel=info'
depends_on:
- rabbit
- db
networks:
- t4y
volumes:
- ./backend:/usr/src/app
env_file:
- .env
environment:
- CELERY_BROKER_URL = 'amqp://admin:mypass@rabbit:5672'
# nginx:
# image: nginx:1.15-alpine
# restart: unless-stopped
# volumes:
# # - ./data/nginx:/etc/nginx/conf.d
# - ./data/certbot/conf:/etc/letsencrypt
# - ./data/certbot/www:/var/www/certbot
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# ports:
# - "80:80"
# - "443:443"
# depends_on:
# - backend
# networks:
# - t4y
# command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''
# certbot: #certbot
# image: certbot/certbot
# restart: unless-stopped
# container_name: certbot
# volumes:
# - ./certbot/conf:/etc/letsencrypt
# - ./certbot/www:/var/www/certbot
# depends_on:
# - nginx
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# prometheus:
# image: prom/prometheus
# container_name: prometheus
# volumes:
# - ./prometheus/config:/etc/prometheus
# - prometheus-data:/prometheus
# ports:
# - 9090:9090
# command:
# - "--storage.tsdb.path=/prometheus"
# - "--config.file=/etc/prometheus/prometheus.yml"
# restart: always
# networks:
# - t4y
# grafana:
# image: grafana/grafana
# container_name: grafana
# ports:
# - 3000:3000
# volumes:
# - grafana-data:/var/lib/grafana
# - ./grafana/provisioning/:/etc/grafana/provisioning/
# restart: always
# depends_on:
# - prometheus
# networks:
# - t4y
# node_exporter:
# image: prom/node-exporter
# volumes:
# - /proc:/host/proc:ro
# - /sys:/host/sys:ro
# - /:/rootfs:ro
# command:
# - "--path.procfs=/host/proc"
# - "--path.rootfs=/rootfs"
# - "--path.sysfs=/host/sys"
# - "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
# - "--collector.cpu"
# - "--collector.loadavg"
# ports:
# - "9100:9100"
# networks:
# - t4y
# cadvisor:
# image: gcr.io/cadvisor/cadvisor:v0.45.0
# container_name: cadvisor
# ports:
# - 8080:8080
# volumes:
# - /:/rootfs:ro
# - /var/run:/var/run:rw
# - /sys:/sys:ro
# - /var/lib/docker/:/var/lib/docker:ro
# - /dev/disk/:/dev/disk:ro
# depends_on:
# - backend
# networks:
# - t4y
# elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:7.10.2
# container_name: elasticsearch
# environment:
# - "discovery.type=single-node"
# ports:
# - "9200:9200"
# networks:
# - t4y
# logstash:
# image: docker.elastic.co/logstash/logstash:7.10.2
# container_name: logstash
# volumes:
# - ./backend/logging/:/logging/
# - ./backend/logging/logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml
# - ./backend/logging/logstash/pipeline:/usr/share/logstash/pipeline
# ports:
# - "5044:5044"
# networks:
# - t4y
# depends_on:
# - elasticsearch
# kibana:
# image: docker.elastic.co/kibana/kibana:7.10.2
# container_name: kibana
# ports:
# - "5601:5601"
# networks:
# - t4y
# depends_on:
# - elasticsearch
# filebeat:
# image: docker.elastic.co/beats/filebeat:7.10.2
# container_name: filebeat
# volumes:
# - ./backend/logging:/logging
# - ./backend/logging/filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
# - /var/lib/docker/containers:/var/lib/docker/containers:ro
# - ./nginx/log:/var/log/nginx # nginx 로그를 호스트와 컨테이너 간에 공유
# networks:
# - t4y
# depends_on:
# - logstash
# - elasticsearch
# - kibana
# command: filebeat -e -c /usr/share/filebeat/filebeat.yml
volumes:
grafana-data:
prometheus-data:
networks:
t4y:
driver: bridge