Skip to content

Commit

Permalink
Make example consistent by using .env file
Browse files Browse the repository at this point in the history
  • Loading branch information
wyarde committed Jul 21, 2021
1 parent c4d2a2f commit f5e5ee8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
8 changes: 4 additions & 4 deletions docs/en/getting-started/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '2.2'
services:
es01:
image: docker.elastic.co/elasticsearch/elasticsearch:{version}
image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
container_name: es01
environment:
- node.name=es01
Expand All @@ -22,7 +22,7 @@ services:
- elastic

es02:
image: docker.elastic.co/elasticsearch/elasticsearch:{version}
image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
container_name: es02
environment:
- node.name=es02
Expand All @@ -41,7 +41,7 @@ services:
- elastic

es03:
image: docker.elastic.co/elasticsearch/elasticsearch:{version}
image: docker.elastic.co/elasticsearch/elasticsearch:${VERSION}
container_name: es03
environment:
- node.name=es03
Expand All @@ -60,7 +60,7 @@ services:
- elastic

kib01:
image: docker.elastic.co/kibana/kibana:{version}
image: docker.elastic.co/kibana/kibana:${VERSION}
container_name: kib01
ports:
- 5601:5601
Expand Down
10 changes: 9 additions & 1 deletion docs/en/getting-started/get-started-docker.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the {stack}: https://www.docker.elastic.co/.
To get the default distributions of {es} and {kib} up and running in Docker,
you can use Docker Compose.

. Create a `docker-compose.yml` file for the Elastic Stack.
. Create an `.env` and `docker-compose.yml` file for the Elastic Stack.
The following example brings up a three node cluster and Kibana so you can see how things work.
This all-in-one configuration is a handy way to bring up your first dev cluster before
you build a distributed deployment with multiple hosts.
Expand All @@ -22,6 +22,14 @@ so the sample compose file is not yet available for this version.
See the {stack-gs-current}/get-started-docker.html[current version] for the latest sample files.
endif::[]
ifeval::["{release-state}"!="unreleased"]
`.env`:
["source","txt",subs="attributes"]
----
COMPOSE_PROJECT_NAME=es
VERSION={version}
----

`.docker-compose.yml`:
["source","yaml",subs="attributes"]
--------------------------------------------
include::docker/docker-compose.yml[]
Expand Down

0 comments on commit f5e5ee8

Please sign in to comment.