Last active
March 14, 2023 08:02
-
-
Save datashaman/106ffb69464c8297b82fe69709b725b4 to your computer and use it in GitHub Desktop.
Opensearch cluster in docker compose
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
app: | |
image: app | |
build: . | |
depends_on: | |
- opensearch-node1 | |
environment: | |
- 'OPENSEARCH_HOSTS=["https://admin:admin@opensearch-node1:9200","https://admin:admin@opensearch-node2:9200","https://admin:admin@opensearch-node3:9200"]' | |
volumes: | |
- .:/var/app | |
networks: | |
- opensearch-net | |
- public-net | |
nginx: | |
image: nginx | |
depends_on: | |
- app | |
ports: | |
- 8080:80 | |
volumes: | |
- .:/var/app | |
- ./nginx.conf:/etc/nginx/conf.d/default.conf | |
networks: | |
- opensearch-net | |
- public-net | |
opensearch-node1: | |
image: opensearchproject/opensearch:2.5.0 | |
environment: | |
- "OPENSEARCH_JAVA_OPTS=-Xms1024m -Xmx1024m" | |
- bootstrap.memory_lock=true | |
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3 | |
- cluster.name=opensearch-cluster | |
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3 | |
- node.name=opensearch-node1 | |
ulimits: &ulimits | |
memlock: | |
soft: -1 | |
hard: -1 | |
nofile: | |
soft: 65536 | |
hard: 65536 | |
volumes: | |
- opensearch-node1-data:/usr/share/opensearch/data | |
networks: | |
- opensearch-net | |
ports: | |
- 9200:9200 | |
- 9600:9600 | |
opensearch-node2: | |
image: opensearchproject/opensearch:2.5.0 | |
environment: | |
- "OPENSEARCH_JAVA_OPTS=-Xms1024m -Xmx1024m" | |
- bootstrap.memory_lock=true | |
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3 | |
- cluster.name=opensearch-cluster | |
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3 | |
- node.name=opensearch-node2 | |
ulimits: *ulimits | |
volumes: | |
- opensearch-node2-data:/usr/share/opensearch/data | |
networks: | |
- opensearch-net | |
opensearch-node3: | |
image: opensearchproject/opensearch:2.5.0 | |
environment: | |
- 'OPENSEARCH_JAVA_OPTS=-Xms1024m -Xmx1024m' | |
- bootstrap.memory_lock=true | |
- cluster.initial_cluster_manager_nodes=opensearch-node1,opensearch-node2,opensearch-node3 | |
- cluster.name=opensearch-cluster | |
- discovery.seed_hosts=opensearch-node1,opensearch-node2,opensearch-node3 | |
- node.name=opensearch-node3 | |
ulimits: *ulimits | |
volumes: | |
- opensearch-node3-data:/usr/share/opensearch/data | |
networks: | |
- opensearch-net | |
opensearch-dashboards: | |
image: opensearchproject/opensearch-dashboards:2.5.0 | |
depends_on: | |
- opensearch-node1 | |
ports: | |
- 5601:5601 | |
environment: | |
- 'OPENSEARCH_HOSTS=["https://admin:admin@opensearch-node1:9200","https://admin:admin@opensearch-node2:9200","https://admin:admin@opensearch-node3:9200"]' | |
networks: | |
- opensearch-net | |
volumes: | |
opensearch-node1-data: | |
opensearch-node2-data: | |
opensearch-node3-data: | |
networks: | |
opensearch-net: | |
public-net: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80 default_server; | |
root /var/app/public; | |
index index.html index.php; | |
charset utf-8; | |
location / { | |
try_files $uri $uri/ /index.php?$query_string; | |
} | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } | |
access_log off; | |
error_log /var/log/nginx/error.log error; | |
sendfile off; | |
client_max_body_size 100m; | |
location ~ .php$ { | |
fastcgi_split_path_info ^(.+.php)(/.+)$; | |
fastcgi_pass app:9000; | |
fastcgi_index index.php; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
fastcgi_intercept_errors off; | |
fastcgi_buffer_size 16k; | |
fastcgi_buffers 4 16k; | |
} | |
location ~ /.ht { | |
deny all; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment