11---
22version : ' 2.1'
33services :
4+ # The environment variable "ELASTIC_VERSION" is used throughout this file to
5+ # specify the version of the Elastic products to run. The default is set in
6+ # in the '.env' file in this folder. It can be overridden with any normal
7+ # technique for setting environment variables, for example:
8+ #
9+ # ELASTIC_VERSION=5.3.0 docker-compose up
10+ #
11+ # REF: https://docs.docker.com/compose/compose-file/#variable-substitution
12+ #
413 elasticsearch :
5- image : docker.elastic.co/elasticsearch/elasticsearch:5.3.0
14+ image : docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_VERSION}
615 environment : ['http.host=0.0.0.0', 'transport.host=127.0.0.1']
716 ports : ['127.0.0.1:9200:9200']
817 networks : ['stack']
@@ -11,7 +20,7 @@ services:
1120 test : ['CMD', 'curl', '-f', '-u', 'elastic:changeme', 'http://localhost:9200']
1221
1322 kibana :
14- image : docker.elastic.co/kibana/kibana:5.3.0
23+ image : docker.elastic.co/kibana/kibana:${ELASTIC_VERSION}
1524 ports : ['127.0.0.1:5601:5601']
1625 networks : ['stack']
1726 depends_on : {elasticsearch: {condition: service_healthy}}
@@ -20,15 +29,15 @@ services:
2029 test : ['CMD', 'curl', '-f', 'http://localhost:5601/login']
2130
2231 logstash :
23- image : docker.elastic.co/logstash/logstash:5.3.0
32+ image : docker.elastic.co/logstash/logstash:${ELASTIC_VERSION}
2433 # Provide a simple pipeline configuration for Logstash with a bind-mounted file.
2534 volumes :
2635 - ./config/logstash.conf:/usr/share/logstash/pipeline/logstash.conf
2736 networks : ['stack']
2837 depends_on : {elasticsearch: {condition: service_healthy}}
2938
3039 filebeat :
31- image : docker.elastic.co/beats/filebeat:5.3.0
40+ image : docker.elastic.co/beats/filebeat:${ELASTIC_VERSION}
3241 group_add : ['root', 'adm']
3342 # If the host system has logs at "/var/log", mount them at "/mnt/log"
3443 # inside the container, where Filebeat can find them.
@@ -37,12 +46,12 @@ services:
3746 depends_on : {elasticsearch: {condition: service_healthy}}
3847
3948 heartbeat :
40- image : docker.elastic.co/beats/heartbeat:5.3.0
49+ image : docker.elastic.co/beats/heartbeat:${ELASTIC_VERSION}
4150 networks : ['stack']
4251 depends_on : {elasticsearch: {condition: service_healthy}}
4352
4453 metricbeat :
45- image : docker.elastic.co/beats/metricbeat:5.3.0
54+ image : docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}
4655 networks : ['stack']
4756 # The commented sections below enable Metricbeat to monitor the Docker host,
4857 # rather than the Metricbeat container. It's problematic with Docker for
@@ -56,7 +65,7 @@ services:
5665 depends_on : {elasticsearch: {condition: service_healthy}}
5766
5867 packetbeat :
59- image : docker.elastic.co/beats/packetbeat:5.3.0
68+ image : docker.elastic.co/beats/packetbeat:${ELASTIC_VERSION}
6069 # Packetbeat needs some elevated privileges capture network traffic.
6170 # We'll grant them with POSIX capabilities.
6271 cap_add : ['NET_RAW', 'NET_ADMIN']
@@ -74,12 +83,12 @@ services:
7483 # Run a short-lived container to import the default dashboards for the Beats.
7584 import_dashboards :
7685 # Any Beats image will do. We'll use Metricbeat.
77- image : docker.elastic.co/beats/metricbeat:5.3.0
86+ image : docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}
7887 networks : ['stack']
7988 command : >-
8089 /usr/share/metricbeat/scripts/import_dashboards
8190 -beat ""
82- -file /usr/share/metricbeat/beats-dashboards-5.3.0 .zip
91+ -file /usr/share/metricbeat/beats-dashboards-${ELASTIC_VERSION} .zip
8392 -es http://elasticsearch:9200
8493 -user elastic
8594 -pass changeme
@@ -88,7 +97,7 @@ services:
8897 # Another short-lived container to create a Kibana index pattern for Logstash.
8998 create_logstash_index_pattern :
9099 # The image just needs curl, and we know that Metricbeat has that.
91- image : docker.elastic.co/beats/metricbeat:5.3.0
100+ image : docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}
92101 networks : ['stack']
93102 # There's currently no API for creating index patterns, so this is a bit hackish.
94103 command : >-
@@ -97,10 +106,10 @@ services:
97106 depends_on : {kibana: {condition: service_healthy}}
98107
99108 set_default_index_pattern :
100- image : docker.elastic.co/beats/metricbeat:5.3.0
109+ image : docker.elastic.co/beats/metricbeat:${ELASTIC_VERSION}
101110 networks : ['stack']
102111 command : >-
103- curl -XPUT http://elastic:changeme@elasticsearch:9200/.kibana/config/5.3.0
112+ curl -XPUT http://elastic:changeme@elasticsearch:9200/.kibana/config/${ELASTIC_VERSION}
104113 -d '{"defaultIndex" : "metricbeat-*"}'
105114 depends_on : {kibana: {condition: service_healthy}}
106115
0 commit comments