blob: dd104ac6051357d147f3f504209cd50eafdb8b33 [file] [log] [blame]
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Apache Flagon Single-Node Build
version: "3"
services:
# Startup
startup:
build: ./startup
depends_on:
- "elasticsearch"
command: bash /opt/entrypoint.sh
# Site
site:
build: ./site
ports:
- 8080:8080
depends_on:
- "logstash"
command: python -m SimpleHTTPServer 8080
# Elasticsearch
elasticsearch:
build: ./elasticsearch/6.5.4
environment:
- NODE_MASTER=true
- NUMBER_OF_MASTERS=1
- NODE_COORDINATE=true
- "DISCOVERY_SERVICE=0.0.0.0"
- NODE_DATA=true
- NODE_INGEST=true
- MAX_LOCAL_STORAGE_NODES=1
- NETWORK_HOST=0.0.0.0
- HTTP_ENABLE=true
- HTTP_CORS_ENABLE=true
- HTTP_CORS_ALLOW_ORIGIN=*
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
healthcheck:
test: ["CMD", "curl","-s" ,"-f", "-u", "http://localhost:9200/_cluster/health"]
# Mount volumes to backup elasticsearch data
# volumes:
# - esdata:/usr/share/elasticsaerch/data
ports:
- "9200:9200"
networks:
- esnet
# Kibana
kibana:
build: ./kibana/6.5.4
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "ELASTICSEARCH_URL=http://elasticsearch:9200"
ports:
- "5601:5601"
depends_on:
- "elasticsearch"
networks:
- esnet
# Logstash
logstash:
build: ./logstash/6.5.4
environment:
- "ELASTICSEARCH_URL=elasticsearch:9200"
ports:
- 8100:8100
volumes:
- ./logstash/6.5.4/pipeline/logstash-userale.conf:/usr/share/logstash/pipeline/logstash-userale.conf
- ./logstash/6.5.4/templates/userale.json:/usr/share/logstash/templates/userale.json
depends_on:
- "elasticsearch"
networks:
- esnet
# Distill
distill:
build: ./distill
ports:
- 8090:8090
depends_on:
- "elasticsearch"
networks:
- esnet
# TAP's Database
db:
build: ./db
image: senssoft/postgres:latest
ports:
- "5432:5432"
# TAP
tap:
build: ./tap
command: bash -c "/usr/src/app/wait-for-postgres.sh"
ports:
- "8010:8010"
depends_on:
- db
links:
- db:db
# Specific container and configuration to monitor the HOST (filesystem, memory, processes,...)
metricbeat:
image: docker.elastic.co/beats/metricbeat:6.5.4
# restart: unless-stopped
user: root
pid: host
volumes:
#The commented sections below enable Metricbeat to monitor the Docker host
#rather than the Metricbeat container. These are used by the system module.
- /proc:/hostfs/proc:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
#We mount the host filesystem so we can report on disk usage with the system module
- /:/hostfs:ro
#Mount the metricbeat configuration so users can make edits
- ./beats/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml
#Mount the modules.d directory into the container. This allows user to
#potentially make changes to the modules and they will be dynamically loaded.
- ./beats/metricbeat/modules.d/:/usr/share/metricbeat/modules.d/
#Allows us to report on docker from the hosts information
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- elasticsearch
environment:
- ELASTICSEARCH_URL=http://elasticsearch:9200
- KIBANA_URL=http://kibana:5601
- LOGSTASH_URL=http://logstash:9600
- POSTGRESQL_URL="postgresql://db:5432/tapdb?sslmode=disable"
- POSTGRESQL_USERNAME=tapuser
- POSTGRESQL_PASSWORD="Dr@p3rUs3r"
extra_hosts:
- "elasticsearch:172.17.0.1" # The IP of docker0 interface to access host from container
- "kibana:172.17.0.1" # The IP of docker0 interface to access host from container
- "logstash:172.17.0.1"
- "db:172.17.0.1"
command: metricbeat -e -system.hostfs=/hostfs -strict.perms=false
network_mode: host # Mandatory to monitor HOST filesystem, memory, processes,...
networks:
esnet:
external:
name: esnet