version: '3.7' services: filebeat: build: context: extensions/filebeat/ args: ELASTIC_VERSION: ${ELASTIC_VERSION} # Run as 'root' instead of 'filebeat' (uid 1000) to allow reading # 'docker.sock' and the host's filesystem. user: root command: # Log to stderr. - -e # Disable config file permissions checks. Allows mounting # 'config/filebeat.yml' even if it's not owned by root. # see: https://www.elastic.co/guide/en/beats/libbeat/current/config-file-permissions.html - --strict.perms=false volumes: - ./extensions/filebeat/config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro,Z - type: bind source: /var/lib/docker/containers target: /var/lib/docker/containers read_only: true - type: bind source: /var/run/docker.sock target: /var/run/docker.sock read_only: true environment: ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-} networks: - elk depends_on: - elasticsearch