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.
69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
services:
|
|
migrate:
|
|
build: .
|
|
restart: "no"
|
|
command: ["deno", "task", "migrate"]
|
|
volumes:
|
|
- ${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:
|
|
build: .
|
|
restart: unless-stopped
|
|
command: ["deno", "task", "jetstream:prod"]
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
opensearch:
|
|
condition: service_healthy
|
|
environment:
|
|
- OPENSEARCH_URL=http://opensearch:9200
|
|
volumes:
|
|
- ${DATA_VOLUME:-data}:/data
|
|
|
|
api:
|
|
build: .
|
|
restart: unless-stopped
|
|
command: ["deno", "task", "server:prod"]
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
opensearch:
|
|
condition: service_healthy
|
|
environment:
|
|
- OPENSEARCH_URL=http://opensearch:9200
|
|
expose:
|
|
- "8080"
|
|
volumes:
|
|
- ${DATA_VOLUME:-data}:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 10m
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
volumes:
|
|
data:
|
|
opensearch-data:
|