|
1 | | -version: '3.2' |
2 | | - |
3 | 1 | services: |
| 2 | + # The 'setup' service runs a one-off script which initializes users inside |
| 3 | + # Elasticsearch — such as 'logstash_internal' and 'kibana_system' — with the |
| 4 | + # values of the passwords defined in the '.env' file. It also creates the |
| 5 | + # roles required by some of these users. |
| 6 | + # |
| 7 | + # This task only needs to be performed once, during the *initial* startup of |
| 8 | + # the stack. Any subsequent run will reset the passwords of existing users to |
| 9 | + # the values defined inside the '.env' file, and the built-in roles to their |
| 10 | + # default permissions. |
| 11 | + # |
| 12 | + # By default, it is excluded from the services started by 'docker compose up' |
| 13 | + # due to the non-default profile it belongs to. To run it, either provide the |
| 14 | + # '--profile=setup' CLI flag to Compose commands, or "up" the service by name |
| 15 | + # such as 'docker compose up setup'. |
| 16 | + setup: |
| 17 | + profiles: |
| 18 | + - setup |
| 19 | + build: |
| 20 | + context: setup/ |
| 21 | + args: |
| 22 | + ELASTIC_VERSION: ${ELASTIC_VERSION} |
| 23 | + init: true |
| 24 | + volumes: |
| 25 | + - ./setup/entrypoint.sh:/entrypoint.sh:ro,Z |
| 26 | + - ./setup/lib.sh:/lib.sh:ro,Z |
| 27 | + - ./setup/roles:/roles:ro,Z |
| 28 | + environment: |
| 29 | + ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-} |
| 30 | + LOGSTASH_INTERNAL_PASSWORD: ${LOGSTASH_INTERNAL_PASSWORD:-} |
| 31 | + KIBANA_SYSTEM_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} |
| 32 | + networks: |
| 33 | + - elk |
| 34 | + depends_on: |
| 35 | + - elasticsearch |
| 36 | + |
4 | 37 | elasticsearch: |
5 | 38 | build: |
6 | 39 | context: elasticsearch/ |
7 | 40 | args: |
8 | | - ELK_VERSION: $ELK_VERSION |
| 41 | + ELASTIC_VERSION: ${ELASTIC_VERSION} |
9 | 42 | volumes: |
10 | | - - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,z |
11 | | - - elasticsearch:/usr/share/elasticsearch/data:z |
| 43 | + - ./elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro,Z |
| 44 | + - elasticsearch:/usr/share/elasticsearch/data:Z |
12 | 45 | ports: |
13 | | - - "9200:9200" |
14 | | - - "9300:9300" |
| 46 | + - 9200:9200 |
| 47 | + - 9300:9300 |
15 | 48 | environment: |
16 | | - ES_JAVA_OPTS: "-Xmx256m -Xms256m" |
17 | | - ELASTIC_PASSWORD: changeme |
| 49 | + node.name: elasticsearch |
| 50 | + ES_JAVA_OPTS: -Xms512m -Xmx512m |
| 51 | + # Bootstrap password. |
| 52 | + # Used to initialize the keystore during the initial startup of |
| 53 | + # Elasticsearch. Ignored on subsequent runs. |
| 54 | + ELASTIC_PASSWORD: ${ELASTIC_PASSWORD:-} |
18 | 55 | # Use single node discovery in order to disable production mode and avoid bootstrap checks. |
19 | 56 | # see: https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html |
20 | 57 | discovery.type: single-node |
21 | 58 | networks: |
22 | 59 | - elk |
| 60 | + restart: unless-stopped |
23 | 61 |
|
24 | 62 | logstash: |
25 | 63 | build: |
26 | 64 | context: logstash/ |
27 | 65 | args: |
28 | | - ELK_VERSION: $ELK_VERSION |
| 66 | + ELASTIC_VERSION: ${ELASTIC_VERSION} |
29 | 67 | volumes: |
30 | | - - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro,z |
31 | | - - ./logstash/pipeline:/usr/share/logstash/pipeline:ro,z |
| 68 | + - ./logstash/config/logstash.yml:/usr/share/logstash/config/logstash.yml:ro,Z |
| 69 | + - ./logstash/pipeline:/usr/share/logstash/pipeline:ro,Z |
32 | 70 | ports: |
33 | | - - "9600:9600" |
34 | | - - "31311:31311" |
| 71 | + - 9600:9600 |
| 72 | + - 31311:31311 |
35 | 73 | environment: |
36 | | - LS_JAVA_OPTS: "-Xmx256m -Xms256m" |
| 74 | + LS_JAVA_OPTS: -Xms256m -Xmx256m |
| 75 | + LOGSTASH_INTERNAL_PASSWORD: ${LOGSTASH_INTERNAL_PASSWORD:-} |
37 | 76 | networks: |
38 | 77 | - elk |
39 | 78 | depends_on: |
40 | 79 | - elasticsearch |
| 80 | + restart: unless-stopped |
41 | 81 |
|
42 | 82 | kibana: |
43 | 83 | build: |
44 | 84 | context: kibana/ |
45 | 85 | args: |
46 | | - ELK_VERSION: $ELK_VERSION |
| 86 | + ELASTIC_VERSION: ${ELASTIC_VERSION} |
47 | 87 | volumes: |
48 | | - - ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro,z |
| 88 | + - ./kibana/config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro,Z |
49 | 89 | ports: |
50 | | - - "5601:5601" |
| 90 | + - 5601:5601 |
| 91 | + environment: |
| 92 | + KIBANA_SYSTEM_PASSWORD: ${KIBANA_SYSTEM_PASSWORD:-} |
51 | 93 | networks: |
52 | 94 | - elk |
53 | 95 | depends_on: |
54 | 96 | - elasticsearch |
| 97 | + restart: unless-stopped |
55 | 98 |
|
56 | 99 | networks: |
57 | 100 | elk: |
|
0 commit comments