-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
executable file
·89 lines (84 loc) · 1.94 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
services:
app:
container_name: fastapi
command: bash -c "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port 80 --log-config=./elk/log-conf.yml --reload"
build: .
restart: on-failure
ports:
- "8000:80"
volumes:
- .:/code/
env_file:
- .env.example
logging:
driver: fluentd
options:
tag: fastapi
depends_on:
postgres:
condition: service_healthy
fluent-bit:
condition: service_started
postgres:
container_name: postgres
image: postgres:15-bullseye
ports:
- "5432:5432"
env_file:
- .env.example
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -q -t 5 -d $${POSTGRES_DB} -U $${POSTGRES_USER}"
]
interval: 10s
timeout: 3s
retries: 3
volumes:
- postgres_data:/var/lib/postgresql/data:cached
depends_on:
fluent-bit:
condition: service_started
logging:
driver: fluentd
options:
tag: postgres
elasticsearch:
image: elasticsearch:8.6.2
container_name: elasticsearch
restart: always
ports:
- "9200:9200"
- "9300:9300"
volumes:
- elasticsearch_data:/usr/share/elasticsearch/data
- ./elk/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml
kibana:
image: kibana:8.6.2
container_name: kibana
ports:
- "5601:5601"
volumes:
- ./elk/kibana.yml:/usr/share/kibana/config/kibana.yml
depends_on:
- elasticsearch
fluent-bit:
container_name: fluent-bit
image: fluent/fluent-bit
restart: always
environment:
- FLB_ES_HOST=elasticsearch
- FLB_ES_PORT=9200
ports:
- 24224:24224
- 24224:24224/udp
volumes:
- ./elk/fluent-bit.conf:/fluent-bit/etc/fluent-bit.conf
depends_on:
- elasticsearch
volumes:
postgres_data:
name: ecommerce_data
elasticsearch_data:
driver: local