From 68db10a089b58889ba146259d18ce579fbecfeff Mon Sep 17 00:00:00 2001 From: Tan Nguyen Date: Fri, 2 Aug 2024 16:40:01 +0700 Subject: [PATCH] feat: add elastic version in env variable --- .env.example | 1 + docker-compose.yml | 2 ++ elastic/Dockerfile | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 6f064d6..0bda7f1 100644 --- a/.env.example +++ b/.env.example @@ -55,6 +55,7 @@ FE_COMMAND=dev ## SSL Domain (true: https,http | false: http) IS_SSL=false +ELASTIC_STACK_VERSION=8.14.3 ## ELASTICSEARCH ELASTICSEARCH_DISCOVERY_TYPE=single-node ELASTICSEARCH_XPACK_SECURITY_ENABLED=false diff --git a/docker-compose.yml b/docker-compose.yml index 52fcf25..7ba7630 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -128,6 +128,8 @@ services: container_name: "${COMPOSE_PROJECT_NAME:-blog}-elasticsearch" build: context: elastic + args: + ELASTIC_STACK_VERSION: ${ELASTIC_STACK_VERSION:-8.14.3} environment: - discovery.type=${ELASTICSEARCH_DISCOVERY_TYPE:-single-node} - xpack.security.enabled=${ELASTICSEARCH_XPACK_SECURITY_ENABLED:-false} diff --git a/elastic/Dockerfile b/elastic/Dockerfile index cdfd4fd..aed3be8 100644 --- a/elastic/Dockerfile +++ b/elastic/Dockerfile @@ -1 +1,3 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:8.14.3 +ARG ELASTIC_STACK_VERSION + +FROM docker.elastic.co/elasticsearch/elasticsearch:${ELASTIC_STACK_VERSION}