Skip to content

Commit

Permalink
Merge pull request #122 from BendingBender/allow-changing-image-names
Browse files Browse the repository at this point in the history
Introduce variables for all used docker images
  • Loading branch information
sherifabdlnaby authored Jan 4, 2025
2 parents fd7f419 + 38bc18b commit 8a219ea
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 12 deletions.
13 changes: 13 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
COMPOSE_PROJECT_NAME=elastic
ELK_VERSION=8.10.2

#----------- Images to use ----------------------#

# the following images will be appended with the ELK_VERSION version number
ELASTICSEARCH_IMAGE_NAME=elastdocker/elasticsearch
LOGSTASH_IMAGE_NAME=elastdocker/logstash
KIBANA_IMAGE_NAME=elastdocker/kibana
APM_SERVER_IMAGE_NAME=elastdocker/apm-server
FILEBEAT_IMAGE_NAME=docker.elastic.co/beats/filebeat

# the following images will be used as is
ELASTICSEARCH_EXPORTER_IMAGE=justwatch/elasticsearch_exporter:1.1.0
LOGSTASH_EXPORTER_IMAGE=alxrem/prometheus-logstash-exporter

#----------- Resources --------------------------#
ELASTICSEARCH_HEAP=1024m
LOGSTASH_HEAP=512m
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.logs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ volumes:
services:
# Docker Logs Shipper ------------------------------
filebeat:
image: docker.elastic.co/beats/filebeat:${ELK_VERSION}
image: ${FILEBEAT_IMAGE_NAME}:${ELK_VERSION}
restart: always
# -e flag to log to stderr and disable syslog/file output
command: -e --strict.perms=false
Expand Down
6 changes: 3 additions & 3 deletions docker-compose.monitor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ services:

# Prometheus Exporters ------------------------------
elasticsearch-exporter:
image: justwatch/elasticsearch_exporter:1.1.0
image: ${ELASTICSEARCH_EXPORTER_IMAGE}
restart: always
command: ["--es.uri", "https://${ELASTIC_USERNAME}:${ELASTIC_PASSWORD}@${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}",
"--es.ssl-skip-verify",
Expand All @@ -15,15 +15,15 @@ services:
- "9114:9114"

logstash-exporter:
image: alxrem/prometheus-logstash-exporter
image: ${LOGSTASH_EXPORTER_IMAGE}
restart: always
ports:
- "9304:9304"
command: ["-logstash.host", "${LOGSTASH_HOST}"]

# Cluster Logs Shipper ------------------------------
filebeat-cluster-logs:
image: docker.elastic.co/beats/filebeat:${ELK_VERSION}
image: ${FILEBEAT_IMAGE_NAME}:${ELK_VERSION}
restart: always
# -e flag to log to stderr and disable syslog/file output
command: -e --strict.perms=false
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.nodes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ volumes:

services:
elasticsearch-1:
image: elastdocker/elasticsearch:${ELK_VERSION}
image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION}
build:
context: elasticsearch/
args:
Expand Down Expand Up @@ -44,7 +44,7 @@ services:
soft: 200000
hard: 200000
elasticsearch-2:
image: elastdocker/elasticsearch:${ELK_VERSION}
image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION}
build:
context: elasticsearch/
args:
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: '3.5'

services:
keystore:
image: elastdocker/elasticsearch:${ELK_VERSION}
image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION}
build:
context: elasticsearch/
args:
Expand All @@ -16,7 +16,7 @@ services:
ELASTIC_PASSWORD: ${ELASTIC_PASSWORD}

certs:
image: elastdocker/elasticsearch:${ELK_VERSION}
image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION}
build:
context: elasticsearch/
args:
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ secrets:

services:
elasticsearch:
image: elastdocker/elasticsearch:${ELK_VERSION}
image: ${ELASTICSEARCH_IMAGE_NAME}:${ELK_VERSION}
build:
context: elasticsearch/
args:
Expand Down Expand Up @@ -77,7 +77,7 @@ services:
test: ["CMD", "sh", "-c", "curl -sf --insecure https://$ELASTIC_USERNAME:$ELASTIC_PASSWORD@localhost:$ELASTICSEARCH_PORT/_cat/health | grep -ioE 'green|yellow' || echo 'not green/yellow cluster status'"]

logstash:
image: elastdocker/logstash:${ELK_VERSION}
image: ${LOGSTASH_IMAGE_NAME}:${ELK_VERSION}
build:
context: logstash/
args:
Expand All @@ -102,7 +102,7 @@ services:
test: ["CMD", "curl", "-s" ,"-XGET", "http://127.0.0.1:9600"]

kibana:
image: elastdocker/kibana:${ELK_VERSION}
image: ${KIBANA_IMAGE_NAME}:${ELK_VERSION}
build:
context: kibana/
args:
Expand All @@ -128,7 +128,7 @@ services:
- "${KIBANA_PORT}:${KIBANA_PORT}"

apm-server:
image: elastdocker/apm-server:${ELK_VERSION}
image: ${APM_SERVER_IMAGE_NAME}:${ELK_VERSION}
build:
context: apm-server/
args:
Expand Down

0 comments on commit 8a219ea

Please sign in to comment.