docker-compose.opensearch.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. services:
  2. opensearch: # This is also the hostname of the container within the Docker network (i.e. https://opensearch/)
  3. image: opensearchproject/opensearch:latest # Specifying the latest available image - modify if you want a specific version
  4. container_name: opensearch
  5. environment:
  6. - discovery.type=single-node
  7. - bootstrap.memory_lock=true # Disable JVM heap memory swapping
  8. - "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx1024m" # Set min and max JVM heap sizes to at least 50% of system RAM
  9. - OPENSEARCH_INITIAL_ADMIN_PASSWORD=Qazwsxedc!@#123 # Sets the demo admin user password when using demo configuration, required for OpenSearch 2.12 and later
  10. ulimits:
  11. memlock:
  12. soft: -1 # Set memlock to unlimited (no soft or hard limit)
  13. hard: -1
  14. nofile:
  15. soft: 65536 # Maximum number of open files for the opensearch user - set to at least 65536
  16. hard: 65536
  17. volumes:
  18. - ./volumes/opensearch/data:/usr/share/opensearch/data # Creates volume called opensearch-data1 and mounts it to the container
  19. ports:
  20. - 9200:9200 # REST API
  21. - 9600:9600 # Performance Analyzer
  22. networks:
  23. - opensearch-net # All of the containers will join the same Docker bridge network
  24. opensearch-dashboards:
  25. image: opensearchproject/opensearch-dashboards:latest # Make sure the version of opensearch-dashboards matches the version of opensearch installed on other nodes
  26. container_name: opensearch-dashboards
  27. ports:
  28. - 5601:5601 # Map host port 5601 to container port 5601
  29. expose:
  30. - "5601" # Expose port 5601 for web access to OpenSearch Dashboards
  31. environment:
  32. OPENSEARCH_HOSTS: '["https://opensearch:9200"]' # Define the OpenSearch nodes that OpenSearch Dashboards will query
  33. volumes:
  34. - ./volumes/opensearch/opensearch_dashboards.yml:/usr/share/opensearch-dashboards/config/opensearch_dashboards.yml
  35. networks:
  36. - opensearch-net
  37. networks:
  38. opensearch-net:
  39. driver: bridge