Guest User

Untitled

a guest
Feb 12th, 2018
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.32 KB | None | 0 0
  1. root@ubuntu:~/stack-docker# cat docker-compose.yml
  2. ---
  3. version: '3'
  4. services:
  5. elasticsearch:
  6. image: docker.elastic.co/elasticsearch/elasticsearch-platinum:${TAG}
  7. container_name: elasticsearch
  8. network_mode: host
  9. environment: ['http.host=0.0.0.0', 'transport.host=127.0.0.1', 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  10. environment:
  11. ES_JAVA_OPTS: "-Xmx4g -Xms4g"
  12.  
  13. ports: ['127.0.0.1:9200:9200']
  14.  
  15. kibana:
  16. image: docker.elastic.co/kibana/kibana:${TAG}
  17. container_name: kibana
  18. environment:
  19. - ELASTICSEARCH_USERNAME=kibana
  20. - ELASTICSEARCH_PASSWORD=${ELASTIC_PASSWORD}
  21. network_mode: host
  22. ports: ['127.0.0.1:5601:5601']
  23. depends_on: ['elasticsearch']
  24.  
  25. logstash:
  26. image: docker.elastic.co/logstash/logstash:${TAG}
  27. container_name: logstash
  28. network_mode: host
  29. environment:
  30. - 'xpack.monitoring.elasticsearch.password=${ELASTIC_PASSWORD}'
  31. # Provide a simple pipeline configuration for Logstash with a bind-mounted file.
  32. volumes:
  33. - ./config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
  34. depends_on: ['elasticsearch', 'setup_logstash']
  35.  
  36. auditbeat:
  37. image: docker.elastic.co/beats/auditbeat:${TAG}
  38. container_name: auditbeat
  39. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  40. cap_add: ['AUDIT_CONTROL', 'AUDIT_READ']
  41. # Auditbeat must run in the main process namespace.
  42. pid: host
  43. network_mode: host
  44. depends_on: ['elasticsearch']
  45.  
  46. filebeat:
  47. image: docker.elastic.co/beats/filebeat:${TAG}
  48. container_name: filebeat
  49. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  50. # If the host system has logs at "/var/log", mount them at "/mnt/log"
  51. # inside the container, where Filebeat can find them.
  52. # volumes: ['/var/log:/mnt/log:ro']
  53. network_mode: host
  54. depends_on: ['elasticsearch', 'setup_filebeat']
  55.  
  56. heartbeat:
  57. image: docker.elastic.co/beats/heartbeat:${TAG}
  58. container_name: heartbeat
  59. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  60. network_mode: host
  61. depends_on: ['elasticsearch', 'setup_heartbeat']
  62.  
  63. metricbeat:
  64. image: docker.elastic.co/beats/metricbeat:${TAG}
  65. container_name: metricbeat
  66. # The commented sections below enable Metricbeat to monitor the Docker host,
  67. # rather than the Metricbeat container. It's problematic with Docker for
  68. # Windows, however, since "/proc", "/sys" etc. don't exist on Windows.
  69. # The same likely applies to OSX (needs testing).
  70. # volumes:
  71. # - /proc:/hostfs/proc:ro
  72. # - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
  73. # - /:/hostfs:ro
  74. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}' # -system.hostfs=/hostfs
  75. network_mode: host
  76. depends_on: ['elasticsearch', 'setup_metricbeat']
  77.  
  78. packetbeat:
  79. image: docker.elastic.co/beats/packetbeat:${TAG}
  80. container_name: packetbeat
  81. # Packetbeat needs some elevated privileges to capture network traffic.
  82. # We'll grant them with POSIX capabilities.
  83. cap_add: ['NET_RAW', 'NET_ADMIN']
  84. # Use "host mode" networking to allow Packetbeat to capture traffic from
  85. # the real network interface on the host, rather than being isolated to the
  86. # container's virtual interface.
  87. network_mode: host
  88. # Since we did that, Packetbeat is not part of the "stack" Docker network
  89. # that the other containers are connected to, and thus can't resolve the
  90. # hostname "elasticsearch". Instead, we'll tell it to find Elasticsearch
  91. # on "localhost", which is the Docker host machine in this context.
  92. command: -e -E 'output.elasticsearch.hosts=["localhost:9200"]' -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  93. depends_on: ['elasticsearch']
  94.  
  95. apm_server:
  96. image: docker.elastic.co/apm/apm-server:${TAG}
  97. container_name: apm_server
  98. ports: ['127.0.0.1:8200:8200']
  99. network_mode: host
  100. command: -e -E 'output.elasticsearch.password=${ELASTIC_PASSWORD}'
  101. depends_on: ['elasticsearch','setup_apm_server']
  102.  
  103. # Run a short-lived container to set up Logstash.
  104. setup_logstash:
  105. image: centos:7
  106. container_name: setup_logstash
  107. volumes: ['./scripts/setup-logstash.sh:/usr/local/bin/setup-logstash.sh:ro']
  108. # The script may have CR/LF line endings if using Docker for Windows, so
  109. # make sure that they don't confuse Bash.
  110. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-logstash.sh | tr -d "\r" | bash']
  111. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  112. network_mode: host
  113. depends_on: ['elasticsearch']
  114.  
  115. setup_kibana:
  116. image: centos:7
  117. container_name: setup_kibana
  118. volumes: ['./scripts/setup-kibana.sh:/usr/local/bin/setup-kibana.sh:ro']
  119. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-kibana.sh | tr -d "\r" | bash']
  120. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  121. network_mode: host
  122. depends_on: ['elasticsearch']
  123.  
  124. setup_auditbeat:
  125. image: docker.elastic.co/beats/auditbeat:${TAG}
  126. container_name: setup_auditbeat
  127. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  128. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s auditbeat']
  129. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  130. network_mode: host
  131. depends_on: ['kibana']
  132.  
  133. setup_filebeat:
  134. image: docker.elastic.co/beats/filebeat:${TAG}
  135. container_name: setup_filebeat
  136. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  137. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s filebeat']
  138. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  139. network_mode: host
  140. depends_on: ['kibana']
  141.  
  142. setup_heartbeat:
  143. image: docker.elastic.co/beats/heartbeat:${TAG}
  144. container_name: setup_heartbeat
  145. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  146. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s heartbeat']
  147. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  148. network_mode: host
  149. depends_on: ['kibana']
  150.  
  151. setup_metricbeat:
  152. image: docker.elastic.co/beats/metricbeat:${TAG}
  153. container_name: setup_metricbeat
  154. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  155. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s metricbeat']
  156. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  157. network_mode: host
  158. depends_on: ['kibana']
  159.  
  160. setup_packetbeat:
  161. image: docker.elastic.co/beats/packetbeat:${TAG}
  162. container_name: setup_packetbeat
  163. cap_add: ['NET_RAW', 'NET_ADMIN']
  164. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  165. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s packetbeat']
  166. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  167. network_mode: host
  168. depends_on: ['kibana']
  169.  
  170. setup_apm_server:
  171. image: docker.elastic.co/apm/apm-server:${TAG}
  172. container_name: setup_apm_server
  173. volumes: ['./scripts/setup-beat.sh:/usr/local/bin/setup-beat.sh:ro']
  174. command: ['/bin/bash', '-c', 'cat /usr/local/bin/setup-beat.sh | tr -d "\r" | bash -s apm-server']
  175. environment: ['ELASTIC_PASSWORD=${ELASTIC_PASSWORD}']
  176. network_mode: host
  177. depends_on: ['elasticsearch','kibana']
Add Comment
Please, Sign In to add comment