mirror of
https://github.com/marcel-dempers/docker-development-youtube-series.git
synced 2025-06-06 17:01:30 +00:00
49 lines
1.4 KiB
YAML
49 lines
1.4 KiB
YAML
version: "3"
|
|
services:
|
|
fluentd:
|
|
container_name: fluentd
|
|
user: root
|
|
build:
|
|
context: .
|
|
image: fluentd
|
|
volumes:
|
|
- /var/lib/docker/containers:/fluentd/log/containers # Example: Reading docker logs
|
|
- ./file:/app/ #Example: Reading logs from a file
|
|
- ./configurations:/fluentd/etc/
|
|
- ./logs:/output/
|
|
logging:
|
|
driver: "local"
|
|
# This app sends logs to Fluentd via HTTP
|
|
http-myapp:
|
|
container_name: http-myapp
|
|
image: alpine
|
|
volumes:
|
|
- ./http:/app
|
|
command: [ /bin/sh , -c , "apk add --no-cache curl && chmod +x /app/send-http-log.sh && ./app/send-http-log.sh"]
|
|
# This app writes logs to a local file
|
|
file-myapp:
|
|
container_name: file-myapp
|
|
image: alpine
|
|
volumes:
|
|
- ./file:/app
|
|
command: [ /bin/sh , -c , "apk add --no-cache curl && chmod +x /app/write-file-log.sh && ./app/write-file-log.sh"]
|
|
elasticsearch: # port 9200
|
|
image: elasticsearch:7.9.1
|
|
container_name: elasticsearch
|
|
environment:
|
|
- node.name=elasticsearch
|
|
- cluster.initial_master_nodes=elasticsearch
|
|
- bootstrap.memory_lock=true
|
|
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
|
ulimits:
|
|
memlock:
|
|
soft: -1
|
|
hard: -1
|
|
kibana:
|
|
image: kibana:7.9.1
|
|
container_name: kibana
|
|
ports:
|
|
- "5601:5601"
|
|
environment:
|
|
ELASTICSEARCH_URL: http://elasticsearch:9200
|
|
ELASTICSEARCH_HOSTS: http://elasticsearch:9200 |