Skip to content

Commit 45ce18b

Browse files
committed
add opensearch to docker-compose
1 parent a4f4cd4 commit 45ce18b

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed

docker-compose.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,34 @@ services:
2929
command:
3030
bash -c "./scripts/wait-for-it-es.sh es-container:9200 && python -m stac_fastapi.elasticsearch.app"
3131

32+
app-opensearch:
33+
container_name: stac-fastapi-os
34+
image: stac-utils/stac-fastapi
35+
restart: always
36+
build:
37+
context: .
38+
dockerfile: Dockerfile.dev
39+
environment:
40+
- APP_HOST=0.0.0.0
41+
- APP_PORT=8080
42+
- RELOAD=true
43+
- ENVIRONMENT=local
44+
- WEB_CONCURRENCY=10
45+
- OS_HOST=172.17.0.1
46+
- OS_PORT=9200
47+
- OS_USE_SSL=false
48+
- OS_VERIFY_CERTS=false
49+
ports:
50+
- "8082:8080"
51+
volumes:
52+
- ./stac_fastapi:/app/stac_fastapi
53+
- ./scripts:/app/scripts
54+
- ./osdata:/usr/share/opensearch/data
55+
depends_on:
56+
- opensearch
57+
command:
58+
bash -c "./scripts/wait-for-it-os.sh os-container:9200 && python -m stac_fastapi.elasticsearch.app"
59+
3260
elasticsearch:
3361
container_name: es-container
3462
image: docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-8.10.4}
@@ -39,3 +67,15 @@ services:
3967
- ./elasticsearch/snapshots:/usr/share/elasticsearch/snapshots
4068
ports:
4169
- "9200:9200"
70+
71+
opensearch:
72+
container_name: os-container
73+
image: opensearchproject/opensearch:latest
74+
environment:
75+
- "discovery.type=single-node"
76+
- "plugins.security.disabled=true"
77+
volumes:
78+
- ./opensearch/config/opensearch.yml:/usr/share/opensearch/config/opensearch.yml
79+
- ./opensearch/snapshots:/usr/share/opensearch/snapshots
80+
ports:
81+
- "9202:9200"

opensearch/config/opensearch.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Cluster Settings
2+
cluster.name: stac-cluster
3+
node.name: es01
4+
network.host: 0.0.0.0
5+
transport.host: 0.0.0.0
6+
discovery.type: single-node
7+
http.port: 9200
8+
9+
path:
10+
repo:
11+
- /usr/share/opensearch/snapshots
12+
13+
######## Start OpenSearch Security Demo Configuration ########
14+
# WARNING: revise all the lines below before you go into production
15+
plugins.security.ssl.transport.pemcert_filepath: esnode.pem
16+
plugins.security.ssl.transport.pemkey_filepath: esnode-key.pem
17+
plugins.security.ssl.transport.pemtrustedcas_filepath: root-ca.pem
18+
plugins.security.ssl.transport.enforce_hostname_verification: false
19+
plugins.security.ssl.http.enabled: true
20+
plugins.security.ssl.http.pemcert_filepath: esnode.pem
21+
plugins.security.ssl.http.pemkey_filepath: esnode-key.pem
22+
plugins.security.ssl.http.pemtrustedcas_filepath: root-ca.pem
23+
plugins.security.allow_unsafe_democertificates: true
24+
plugins.security.allow_default_init_securityindex: true
25+
plugins.security.authcz.admin_dn:
26+
- CN=kirk,OU=client,O=client,L=test, C=de
27+
28+
plugins.security.audit.type: internal_opensearch
29+
plugins.security.enable_snapshot_restore_privilege: true
30+
plugins.security.check_snapshot_restore_write_privileges: true
31+
plugins.security.restapi.roles_enabled: ["all_access", "security_rest_api_access"]
32+
plugins.security.system_indices.enabled: true
33+
plugins.security.system_indices.indices: [".plugins-ml-config", ".plugins-ml-connector", ".plugins-ml-model-group", ".plugins-ml-model", ".plugins-ml-task", ".plugins-ml-conversation-meta", ".plugins-ml-conversation-interactions", ".opendistro-alerting-config", ".opendistro-alerting-alert*", ".opendistro-anomaly-results*", ".opendistro-anomaly-detector*", ".opendistro-anomaly-checkpoints", ".opendistro-anomaly-detection-state", ".opendistro-reports-*", ".opensearch-notifications-*", ".opensearch-notebooks", ".opensearch-observability", ".ql-datasources", ".opendistro-asynchronous-search-response*", ".replication-metadata-store", ".opensearch-knn-models", ".geospatial-ip2geo-data*"]
34+
node.max_local_storage_nodes: 3
35+
######## End OpenSearch Security Demo Configuration ########

0 commit comments

Comments
 (0)