chore(docker): add OpenSearch service to compose
Single-node cluster with the security plugin disabled (in-cluster HTTP only). jetstream and api now depend on it being healthy and receive OPENSEARCH_URL via env.
This commit is contained in:
@@ -6,6 +6,27 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ${DATA_VOLUME:-data}:/data
|
- ${DATA_VOLUME:-data}:/data
|
||||||
|
|
||||||
|
opensearch:
|
||||||
|
image: opensearchproject/opensearch:2.18.0
|
||||||
|
restart: unless-stopped
|
||||||
|
environment:
|
||||||
|
- discovery.type=single-node
|
||||||
|
- DISABLE_SECURITY_PLUGIN=true
|
||||||
|
- OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m
|
||||||
|
volumes:
|
||||||
|
- ${OPENSEARCH_VOLUME:-opensearch-data}:/usr/share/opensearch/data
|
||||||
|
expose:
|
||||||
|
- "9200"
|
||||||
|
healthcheck:
|
||||||
|
test: [
|
||||||
|
"CMD-SHELL",
|
||||||
|
"curl -fs http://localhost:9200/_cluster/health || exit 1",
|
||||||
|
]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 10
|
||||||
|
start_period: 30s
|
||||||
|
|
||||||
jetstream:
|
jetstream:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -13,6 +34,10 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
migrate:
|
migrate:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
|
opensearch:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
- OPENSEARCH_URL=http://opensearch:9200
|
||||||
volumes:
|
volumes:
|
||||||
- ${DATA_VOLUME:-data}:/data
|
- ${DATA_VOLUME:-data}:/data
|
||||||
|
|
||||||
@@ -23,6 +48,10 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
migrate:
|
migrate:
|
||||||
condition: service_completed_successfully
|
condition: service_completed_successfully
|
||||||
|
opensearch:
|
||||||
|
condition: service_healthy
|
||||||
|
environment:
|
||||||
|
- OPENSEARCH_URL=http://opensearch:9200
|
||||||
expose:
|
expose:
|
||||||
- "8080"
|
- "8080"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -36,3 +65,4 @@ services:
|
|||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
data:
|
data:
|
||||||
|
opensearch-data:
|
||||||
|
|||||||
Reference in New Issue
Block a user