반응형
Recent Posts
Recent Comments
관리 메뉴

개발잡부

[docker] docker-compose 로 로컬테스트 환경구축하기 본문

ElasticStack/System

[docker] docker-compose 로 로컬테스트 환경구축하기

닉의네임 2022. 1. 7. 11:29
반응형
# 백그라운드 실행 빌드 옵션
docker compose up -d --build

#생성된 컨테이너 중지/삭제
docker compose down

docker-compose.yml

version: '3.2'

services:
  elasticsearch:
    container_name: doo_es
    build:
      context: elasticsearch/
      args:
        ELK_VERSION: $ELK_VERSION
    volumes:
      - type: bind
        source: ./elasticsearch/config/elasticsearch.yml
        target: /usr/share/elasticsearch/config/elasticsearch.yml
        read_only: true
      - type: volume
        source: elasticsearch
        target: /usr/share/elasticsearch/data
    ports:
      - "9200:9200"
      - "9300:9300"
    environment:
      ES_JAVA_OPTS: "-Xmx1g -Xms1g"
      ELASTIC_PASSWORD: datalake
      discovery.type: single-node
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      - elk
  kibana:
    container_name: doo_kibana
    build:
      context: kibana/
      args:
        ELK_VERSION: $ELK_VERSION
    volumes:
      - type: bind
        source: ./kibana/config/kibana.yml
        target: /usr/share/kibana/config/kibana.yml
        read_only: true
    ports:
      - "5601:5601"
    networks:
      - elk
    depends_on:
      - elasticsearch
networks:
  elk:
    driver: bridge
volumes:
  elasticsearch:

Dockerfile

 

ARG ELK_VERSION

# https://www.docker.elastic.co/
FROM docker.elastic.co/elasticsearch/elasticsearch:${ELK_VERSION}

COPY plugin/kr-danalyzer-7.12.1.zip plugin/kr-danalyzer-7.12.1.zip
RUN elasticsearch-plugin install file:///usr/share/elasticsearch/plugin/kr-danalyzer-7.12.1.zip

elasticsearch.yml

---
## Default Elasticsearch configuration from Elasticsearch base image.
## https://github.com/elastic/elasticsearch/blob/master/distribution/docker/src/docker/config/elasticsearch.yml
#
cluster.name: "datalake-dev"
network.host: 0.0.0.0

## X-Pack settings
## see https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-xpack.html
#
xpack.license.self_generated.type: basic
xpack.security.enabled: true
xpack.monitoring.collection.enabled: true

 

 

반응형

'ElasticStack > System' 카테고리의 다른 글

[es] logrotate  (0) 2022.09.15
Elasticsearch 7.9.2 multi hosts  (0) 2021.07.06
DNS 캐시 설정  (0) 2020.08.12
스레드 수  (0) 2020.08.12
가상 메모리  (0) 2020.08.12
Comments