Skip to content

Instantly share code, notes, and snippets.

@rasata
Forked from wshayes/Dockerfile-es
Created August 14, 2018 10:15
Show Gist options
  • Save rasata/c99a5419c3ce6b9243e915bbe8844f84 to your computer and use it in GitHub Desktop.
Save rasata/c99a5419c3ce6b9243e915bbe8844f84 to your computer and use it in GitHub Desktop.

Revisions

  1. @wshayes wshayes revised this gist Sep 18, 2017. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions elasticsearch.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    http.cors.enabled : true
    http.cors.allow-origin : "*"
    http.cors.allow-methods : OPTIONS, HEAD, GET, POST, PUT, DELETE
    http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type, Content-Length
  2. @wshayes wshayes revised this gist Sep 18, 2017. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -54,6 +54,9 @@ services:
    # - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    # - xpack.security.enabled=false
    # - xpack.watcher.enabled=false
    # - xpack.monitoring.enabled=false
    # - xpack.ml.enabled=false
    # - xpack.graph.enabled=false
    # ulimits:
    # memlock:
    # soft: -1
  3. @wshayes wshayes revised this gist Jul 31, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -68,7 +68,7 @@ services:
    # Access Kibana at http://kibana.test (if using Traefik)
    kibana:
    container_name: kibana
    image: docker.elastic.co/kibana/kibana:5.4.3 # must match elasticsearch image
    image: docker.elastic.co/kibana/kibana:5.5.1 # must match elasticsearch image
    ports:
    - 5611:5601
    volumes:
  4. @wshayes wshayes revised this gist Jul 31, 2017. 1 changed file with 0 additions and 8 deletions.
    8 changes: 0 additions & 8 deletions Dockerfile-es
    Original file line number Diff line number Diff line change
    @@ -4,11 +4,3 @@ RUN \
    mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
    mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
    /usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack

    # cleanup unused modules to slim image
    RUN rm -rf modules/ingest-common
    RUN rm -rf modules/lang-expression
    RUN rm -rf modules/lang-groovy
    RUN rm -rf modules/lang-mustache
    RUN rm -rf modules/percolator
    RUN rm -rf modules/transport-netty3
  5. @wshayes wshayes revised this gist Jul 31, 2017. 2 changed files with 50 additions and 8 deletions.
    14 changes: 14 additions & 0 deletions Dockerfile-es
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    FROM docker.elastic.co/elasticsearch/elasticsearch:5.5.1

    RUN \
    mv /usr/share/elasticsearch/plugins/x-pack /usr/share/elasticsearch/plugins/.removing-x-pack && \
    mv /usr/share/elasticsearch/plugins/.removing-x-pack /usr/share/elasticsearch/plugins/x-pack && \
    /usr/share/elasticsearch/bin/elasticsearch-plugin remove x-pack

    # cleanup unused modules to slim image
    RUN rm -rf modules/ingest-common
    RUN rm -rf modules/lang-expression
    RUN rm -rf modules/lang-groovy
    RUN rm -rf modules/lang-mustache
    RUN rm -rf modules/percolator
    RUN rm -rf modules/transport-netty3
    44 changes: 36 additions & 8 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -12,29 +12,57 @@ services:
    # Access api endpoint at http://localhost:9200
    elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3
    image: elasticsearch
    build:
    context: .
    dockerfile: Dockerfile-es
    ports:
    - "9200:9200"
    expose: # exposed by the dockerfile
    - "9200"
    - "9300"
    volumes:
    - elasticsearch_data:/usr/share/elasticsearch/data
    - ce-esdata:/usr/share/elasticsearch/data
    - ./elasticsearch.yml:/conf/elasticsearch.yml
    # logging:
    # driver: none
    environment:
    - cluster.name=docker-cluster
    - bootstrap.memory_lock=true
    - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    - xpack.security.enabled=false
    - xpack.watcher.enabled=false
    ulimits:
    memlock:
    soft: -1
    hard: -1
    # deploy:
    # resources:
    # limits:
    # memory: 1g
    restart: always

    # Access api endpoint at http://localhost:9200
    # With XPack plugin
    # elasticsearch:
    # container_name: elasticsearch
    # image: docker.elastic.co/elasticsearch/elasticsearch:5.5.1
    # ports:
    # - "9200:9200"
    # volumes:
    # - elasticsearch_data:/usr/share/elasticsearch/data
    # - ./elasticsearch.yml:/conf/elasticsearch.yml
    # # logging:
    # # driver: none
    # environment:
    # - cluster.name=docker-cluster
    # - bootstrap.memory_lock=true
    # - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    # - xpack.security.enabled=false
    # - xpack.watcher.enabled=false
    # ulimits:
    # memlock:
    # soft: -1
    # hard: -1
    # # deploy:
    # # resources:
    # # limits:
    # # memory: 1g
    # restart: always

    # Access Kibana at http://localhost:5601 without Traefik
    # Access Kibana at http://kibana.test (if using Traefik)
  6. @wshayes wshayes created this gist Jun 28, 2017.
    74 changes: 74 additions & 0 deletions docker-compose.yml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,74 @@
    # docker-compose build && docker-compose up -d
    version: "3.2"

    volumes:
    elasticsearch_data:
    driver: local
    kibana_data:
    driver: local

    services:

    # Access api endpoint at http://localhost:9200
    elasticsearch:
    container_name: elasticsearch
    image: docker.elastic.co/elasticsearch/elasticsearch:5.4.3
    ports:
    - "9200:9200"
    volumes:
    - elasticsearch_data:/usr/share/elasticsearch/data
    - ./elasticsearch.yml:/conf/elasticsearch.yml
    # logging:
    # driver: none
    environment:
    - cluster.name=docker-cluster
    - bootstrap.memory_lock=true
    - "ES_JAVA_OPTS=-Xms512m -Xmx512m"
    - xpack.security.enabled=false
    - xpack.watcher.enabled=false
    ulimits:
    memlock:
    soft: -1
    hard: -1
    # deploy:
    # resources:
    # limits:
    # memory: 1g
    restart: always

    # Access Kibana at http://localhost:5601 without Traefik
    # Access Kibana at http://kibana.test (if using Traefik)
    kibana:
    container_name: kibana
    image: docker.elastic.co/kibana/kibana:5.4.3 # must match elasticsearch image
    ports:
    - 5611:5601
    volumes:
    - kibana_data:/usr/share/kibana/data
    labels: # used for Traefik dynamic configuration
    - traefik.enable=true
    - traefik.backend=kibana
    - traefik.frontend.rule=Host:kibana.test
    - traefik.port=5601
    depends_on:
    - elasticsearch
    environment:
    - ELASTICSEARCH_URL=http://elasticsearch:9200
    - xpack.security.enabled=false
    # logging:
    # driver: none
    restart: always

    # Reverse proxy for BEL API and other web endpoints
    # Access mgmt interface at http://localhost:8088
    # have to add kibana.test to /etc/hosts or /windows/system32/drivers/etc/hosts
    traefik:
    image: traefik:latest
    container_name: traefik
    ports:
    - "80:80"
    - "443:443"
    - "8088:8088"
    volumes:
    - /var/run/docker.sock:/var/run/docker.sock
    - ./traefik.toml:/traefik.toml
    27 changes: 27 additions & 0 deletions traefik.toml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    defaultEntryPoints = ["http"]

    # logLevel = "DEBUG"

    [web]
    address = ":8088"
    [web.statistics]

    [entryPoints]
    [entryPoints.http]
    address = ":80"

    ################################################################
    # Docker configuration backend
    ################################################################
    [docker]

    endpoint = "unix:///var/run/docker.sock"
    domain = "docker.localhost"
    watch = true

    # Expose containers by default in traefik
    exposedbydefault = false

    # Use Swarm Mode services as data provider
    swarmmode = false