Skip to content

Commit

Permalink
make opensearch work in docker dev
Browse files Browse the repository at this point in the history
  • Loading branch information
huumn committed Sep 24, 2023
1 parent ee851d2 commit d9c4753
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ NOSTR_PRIVATE_KEY=<YOUR NOSTR PRIVATE KEY IN HEX>

# static things
NEXTAUTH_URL=http://localhost:3000/api/auth
SELF_URL=http://localhost:3000
SELF_URL=http://app:3000
PUBLIC_URL=http://localhost:3000
LND_CONNECT_ADDRESS=03cc1d0932bb99b0697f5b5e5961b83ab7fd66f1efc4c9f5c7bad66c1bcbe78f02@xhlmkj7mfrl6ejnczfwl2vqik3xim6wzmurc2vlyfoqw2sasaocgpuad.onion:9735
NEXTAUTH_SECRET=3_0W_PhDRZVanbeJsZZGIEljexkKoGbL6qGIqSwTjjI
Expand Down
60 changes: 32 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
- ./:/app
links:
- db
- opensearch
worker:
container_name: worker
build: ./worker
Expand All @@ -47,6 +48,8 @@ services:
- ./:/app
links:
- db
- app
- opensearch
entrypoint: ["/bin/sh", "-c"]
command:
- node worker/index.js
Expand All @@ -71,41 +74,42 @@ services:
image: opensearchproject/opensearch:latest
container_name: opensearch
environment:
- cluster.name=opensearch-cluster
- node.name=opensearch
- discovery.seed_hosts=opensearch
- cluster.initial_cluster_manager_nodes=opensearch
- bootstrap.memory_lock=true
- discovery.type=single-node
- plugins.security.disabled=true
- action.auto_create_index=true
- "OPENSEARCH_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- opensearch-data:/usr/share/opensearch/data
- ./opensearch:/sn
ports:
- 9200:9200 # REST API
- 9600:9600 # Performance Analyzer
entrypoint: ["/bin/sh", "-c"]
command:
- /sn/init-shim.sh
dashboards:
profiles:
- aux
build: ./opensearch/dashboards
container_name: dashboards
volumes:
- os:/usr/share/opensearch/data
- ./:/app
command: >
bash -c '
set -m
/usr/share/opensearch/opensearch-docker-entrypoint.sh &
until curl -sS "http://localhost:9200/_cat/health?h=status" -ku admin:admin | grep -q "green\|yellow"; do
echo "Waiting for OpenSearch to start..."
sleep 1
done
echo "OpenSearch started."
curl -X PUT "http://localhost:9200/item" -ku admin:admin
echo "OpenSearch index created."
fg
'
os-dashboard:
image: opensearchproject/opensearch-dashboards:latest
container_name: os-dashboard
environment:
- opensearch.ssl.verificationMode=none
- server.ssl.enabled=false
- plugins.security.disabled=true
- DISABLE_SECURITY_DASHBOARDS_PLUGIN=true
- OPENSEARCH_HOSTS=http://opensearch:9200
ports:
- 5601:5601
expose:
- "5601"
environment:
OPENSEARCH_HOSTS: '["http://opensearch:9200"]'
links:
- opensearch
volumes:
db:
opensearch-data:
os:
3 changes: 0 additions & 3 deletions opensearch/dashboards/Dockerfile

This file was deleted.

2 changes: 0 additions & 2 deletions opensearch/dashboards/opensearch_dashboards.yml

This file was deleted.

30 changes: 0 additions & 30 deletions opensearch/first-time-check.sh

This file was deleted.

3 changes: 0 additions & 3 deletions opensearch/init-shim.sh

This file was deleted.

1 change: 1 addition & 0 deletions worker/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async function _indexItem (item) {

export function indexItem ({ apollo }) {
return async function ({ data: { id } }) {
console.log('indexing item, fetching ...', id)
// 1. grab item from database
// could use apollo to avoid duping logic
// when grabbing sats and user name, etc
Expand Down

0 comments on commit d9c4753

Please sign in to comment.