-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
204 lines (192 loc) · 5.01 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
---
volumes:
# loki-data:
postgres-data:
prometheus-data:
# grafana-data:
# driver: local
# grafana_logs:
networks:
app-network:
driver: bridge
services:
# nginx:
# image: nginx:latest
# container_name: nginx
# ports:
# - "80:80"
# volumes:
# - ./infrastructure/nginx/nginx.conf:/etc/nginx/nginx.conf
# depends_on:
# - python
# networks:
# - app-network
# grafana:
# image: grafana/grafana:latest
# container_name: grafana
# ports:
# - "3000:3000"
# environment:
# GF_LOG_MODE: file
# GF_METRICS_ENABLED: "true"
# GF_LOG_DIR: /var/log/grafana
# GF_SECURITY_ADMIN_USER: admin
# GF_AUTH_ANONYMOUS_ENABLED: true
# GF_AUTH_ANONYMOUS_ORG_ROLE: Admin
# GF_PROMETHEUS_ENDPOINT_ENABLED: "true"
# GF_METRICS_BASIC_AUTH_USERNAME: grafana
# GF_SERVER_ROOT_URL: http://localhost:3000
# GF_PATHS_PROVISIONING: /etc/grafana/provisioning
# GF_PROMETHEUS_ENDPOINT_BASIC_AUTH_USERNAME: grafana
# GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_ADMIN_PASSWORD}
# GF_METRICS_BASIC_AUTH_PASSWORD: GRAFANA_METRICS_PASSWORD
# GF_PROMETHEUS_ENDPOINT_BASIC_AUTH_PASSWORD: GRAFANA_PROMETHEUS_PASSWORD
# volumes:
# - grafana-data:/var/lib/grafana
# - grafana_logs:/var/log/grafana
# - ./monitoring/Grafana/grafana-provisioning/datasources/datasources.yml:/etc/grafana/provisioning/datasources/prometheus-datasource.yaml
# networks:
# - app-network
# depends_on:
# - loki
# - prometheus
# restart: unless-stopped
# loki:
# image: grafana/loki:latest
# container_name: loki
# ports:
# - "3100:3100"
# volumes:
# - ./monitoring/Loki/loki-config.yaml:/etc/loki/loki-config.yaml
# command: ["-config.file=/etc/loki/loki-config.yaml"]
# networks:
# - app-network
python:
build:
context: ./src
dockerfile: Dockerfile
deploy:
resources:
limits:
cpus: "0.25"
reservations:
cpus: "0.5"
container_name: python
volumes:
- ./src:/app
environment:
FLASK_APP: ./app/app.py
FLASK_ENV: production
DATABASE_URL: postgresql://POSTGRES_USER:POSTGRES_PASSWORD@postgres:5432/POSTGRES_DB
PYTHONPATH: /app/
RABBITMQ_URL: amqp://rabbitmq:5672/
restart: always
depends_on:
# - prometheus
- postgres
networks:
- app-network
command: flask run --host=0.0.0.0
ports:
- "5000:5000"
# logstash:
# image: docker.elastic.co/logstash/logstash:8.6.0
# deploy:
# resources:
# limits:
# cpus: "1.0"
# container_name: logstash
# depends_on:
# - rabbitmq
# - elasticsearch
# ports:
# - "5044:5044"
# volumes:
# - ./monitoring/logstash/config:/usr/share/logstash/config
# - ./monitoring/logstash/config/jvm.options:/usr/share/logstash/config/jvm.options
# networks:
# - app-network
postgres:
image: postgres:latest
environment:
POSTGRES_USER: POSTGRES_USER
POSTGRES_PASSWORD: POSTGRES_PASSWORD
POSTGRES_DB: POSTGRES_DB
volumes:
- postgres-data:/var/lib/postgresql/data
- ./scripts/sql/Postgres/PostgreSQL.conf:/etc/postgresql/postgresql.conf
networks:
- app-network
deploy:
resources:
limits:
cpus: "0.25"
reservations:
cpus: "1.0"
container_name: postgres
ports:
- "5432:5432"
rabbitmq:
image: rabbitmq:3-management
deploy:
resources:
limits:
cpus: "0.5"
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
networks:
- app-network
# promtail:
# image: grafana/promtail:latest
# container_name: promtail
# volumes:
# - ./monitoring/Promtail/config:/etc/promtail
# - ./src/archivo.log:/var/log/archivo.log
# networks:
# - app-network
# depends_on:
# - loki
# command: ["-config.file=/etc/promtail/promtail-config.yaml"]
# prometheus:
# image: prom/prometheus
# deploy:
# resources:
# limits:
# cpus: "0.25"
# reservations:
# cpus: "1.0"
# container_name: prometheus
# ports:
# - "9090:9090"
# volumes:
# - ./monitoring/Prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
# - prometheus-data:/prometheus
# networks:
# - app-network
# elasticsearch:
# image: docker.elastic.co/elasticsearch/elasticsearch:8.6.0
# deploy:
# resources:
# limits:
# cpus: "1.0"
# container_name: elasticsearch
# environment:
# - discovery.type=single-node
# - ES_JAVA_OPTS=-Xms1g -Xmx1g
# ports:
# - "9200:9200"
# networks:
# - app-network
# zipkin:
# image: openzipkin/zipkin
# container_name: zipkin
# ports:
# - "9411:9411"
# - "9410:9410"
# environment:
# - STORAGE_TYPE=mem
# - METRICS_EXPORTER=prometheus
# networks:
# - app-network