Add elasticsearch for full-text search.

This commit is contained in:
Sunoru 2024-04-27 21:33:35 +01:00
parent dcf5a1caab
commit 952016dc41
Signed by: sunoru
GPG key ID: 442B84461FD0355A
3 changed files with 36 additions and 3 deletions

Binary file not shown.

View file

@ -44,6 +44,7 @@ services:
depends_on:
- db
- redis
- es
volumes:
- ./mastodon:/opt/my-mastodon
@ -119,6 +120,38 @@ services:
volumes:
- ./data/redis:/mnt/redis:ro
# Comment this service if you want to disable full-text search.
es:
container_name: mastodon-es
restart: always
image: elasticsearch:7.17.20
mem_limit: 1.5gb
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m -Des.enforce.bootstrap.checks=true"
- "xpack.license.self_generated.type=basic"
- "xpack.security.enabled=false"
- "xpack.watcher.enabled=false"
- "xpack.graph.enabled=false"
- "xpack.ml.enabled=false"
- "bootstrap.memory_lock=true"
- "cluster.name=es-mastodon"
- "discovery.type=single-node"
- "thread_pool.write.queue_size=1000"
networks:
- internal_network
- external_network
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
volumes:
- ./data/elasticsearch:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
networks:
external_network:
internal_network:

View file

@ -44,6 +44,6 @@ SMTP_OPENSSL_VERIFY_MODE=none
SMTP_ENABLE_STARTTLS=auto
SMTP_FROM_ADDRESS='Mastodon <noreply@example.com>'
# ES_ENABLED=true
# ES_HOST=localhost
# ES_PORT=9200
ES_ENABLED=true
ES_HOST=es
ES_PORT=9200