docker-compose.opensearch.yml 2.0 KB

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