-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
205 lines (196 loc) · 4.14 KB
/
docker-compose.yml
File metadata and controls
205 lines (196 loc) · 4.14 KB
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
version: "3.9"
services:
elasticsearch:
image: elasticsearch:7.17.18
container_name: elasticsearch
environment:
- bootstrap.memory_lock=true
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 9200:9200
stdin_open: true
tty: true
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "50"
deploy:
resources:
limits:
cpus: '1'
memory: 1GB
reservations:
cpus: '1'
memory: 1GB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
logstash:
container_name: logstash
image: logstash:7.17.18
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./logstash/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
- ./logstash/logstash.template.json:/usr/share/logstash/templates/logstash.template.json
ports:
- 5044:5044
links:
- elasticsearch:elasticsearch
depends_on:
- elasticsearch
stdin_open: true
tty: true
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "50"
deploy:
resources:
limits:
cpus: '0.5'
memory: 512MB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
kibana:
container_name: kibana
image: kibana:7.17.18
ulimits:
memlock:
soft: -1
hard: -1
ports:
- 5601:5601
links:
- elasticsearch:elasticsearch
depends_on:
- elasticsearch
stdin_open: true
tty: true
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "50"
deploy:
resources:
limits:
cpus: '0.5'
memory: 512MB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
filebeat:
user: root
container_name: filebeat
image: elastic/filebeat:7.17.18
links:
- logstash:logstash
depends_on:
- logstash
- app
volumes:
- /var/run/docker.sock:/host_docker/docker.sock
- ./logs:/usr/share/filebeat/mylogs
- ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml
command: [ "--strict.perms=false" ]
ulimits:
memlock:
soft: -1
hard: -1
stdin_open: true
tty: true
networks:
- app_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "50"
deploy:
mode: global
resources:
limits:
cpus: '0.2'
memory: 512MB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
db:
image: postgres:12-bullseye
container_name: postgres_db
environment:
POSTGRES_USER: storage_admin
POSTGRES_PASSWORD: THw7l0bxvPPkWUhP
POSTGRES_DB: strg_users_db
ports:
- "5435:5432"
volumes:
- ./docker-data/postgres:/var/lib/postgresql/data
- ./db_init/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- app_network
deploy:
resources:
limits:
cpus: '0.3'
memory: 512MB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
app:
build:
context: .
dockerfile: Dockerfile
container_name: python_app
volumes:
- ./logs:/app/logs
depends_on:
- db
environment:
DATABASE_URL: postgresql://storage_admin:THw7l0bxvPPkWUhP@db:5432/strg_users_db
ports:
- "8000:8000"
networks:
- app_network
deploy:
resources:
limits:
cpus: '0.3'
memory: 512MB
restart_policy:
condition: on-failure
max_attempts: 3
delay: 5s
window: 20s
volumes:
postgres_data:
networks:
app_network:
driver: bridge