-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathdocker-compose.logs.yml
70 lines (64 loc) · 2.2 KB
/
docker-compose.logs.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
version: "3"
services:
setup-rabbitmq:
image: rabbitmq:3.7-management-alpine
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
volumes:
- rabbitmq:/var/lib/rabbitmq
depends_on:
rabbitmq:
condition: service_healthy
command: >
bash -c '
echo "Setting Rabbitmq";
rabbitmqctl -n rabbit@sgp-rabbitmq add_vhost "${RABBITMQ_VHOST_APP}"
rabbitmqctl -n rabbit@sgp-rabbitmq set_permissions -p "${RABBITMQ_VHOST_APP}" user ".*" ".*" ".*"
rabbitmqadmin -H sgp-rabbitmq -u "${RABBITMQ_DEFAULT_USER}" -p "${RABBITMQ_DEFAULT_PASS}" --vhost=logs declare exchange name="ExchangeApplicationLog" type=topic
rabbitmqadmin -H sgp-rabbitmq -u "${RABBITMQ_DEFAULT_USER}" -p "${RABBITMQ_DEFAULT_PASS}" --vhost=logs declare queue name="ApplicationLog" durable=true
rabbitmqadmin -H sgp-rabbitmq -u "${RABBITMQ_DEFAULT_USER}" -p "${RABBITMQ_DEFAULT_PASS}" --vhost=logs declare binding source="ExchangeApplicationLog" destination_type="queue" destination="ApplicationLog" routing_key="ApplicationLog"
echo "All done!";'
networks:
- sgp-network
rabbitmq:
image: rabbitmq:3.7-management-alpine
hostname: sgp-rabbitmq
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- RABBITMQ_DEFAULT_VHOST=logs
volumes:
- rabbitmq:/var/lib/rabbitmq
ports:
- "5672:5672"
- "15672:15672"
networks:
- sgp-network
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
logstash:
image: docker.elastic.co/logstash/logstash:8.1.1
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
mem_limit: 1073741824
volumes:
- ./configuracoes/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
depends_on:
rabbitmq:
condition: service_healthy
ulimits:
memlock:
soft: -1
hard: -1
networks:
- sgp-network
networks:
sgp-network:
volumes:
rabbitmq:
driver: local