Move elasticsearch into separate compose file #33

Merged
ammaratef45 merged 3 commits from change/es-compose into main 2026-01-04 22:19:00 +00:00
3 changed files with 35 additions and 20 deletions

View File

@ -67,9 +67,7 @@ REDIS_PORT=6379
# ElasticSearch
# --------------------------------------
ES_ENABLED=true
ES_HOST=es
ES_PORT=9200
# COMPOSE_FILE="$COMPOSE_FILE:compose.elasticsearch.yml"
ammaratef45 marked this conversation as resolved Outdated

I'm assuming whoever uncomments the COMPOSE_FILE="$COMPOSE_FILE:compose.elasticsearch.yml" line would like ES_ENABLED=true to be the value, so no need to keep it in env file?

I'm assuming whoever uncomments the `COMPOSE_FILE="$COMPOSE_FILE:compose.elasticsearch.yml"` line would like `ES_ENABLED=true` to be the value, so no need to keep it in env file?

Oops, you already addressed that in the PR description, sorry about that 😆

potentially you might want to keep the service running, but not have it enabled in mastodon? For debugging or something?

I doubt this is a common enough use-case that we would want to allow for it from the configurations, devs can always use --chaos for such use cases, wdyt?

Oops, you already addressed that in the PR description, sorry about that 😆 > potentially you might want to keep the service running, but not have it enabled in mastodon? For debugging or something? I doubt this is a common enough use-case that we would want to allow for it from the configurations, devs can always use `--chaos` for such use cases, wdyt?

I was on the fence about whether to hardcode the values, but given your comment I think it makes sense to just make it simple, so you only have to include the extra compose file, and all the values are set right.

I was on the fence about whether to hardcode the values, but given your comment I think it makes sense to just make it simple, so you only have to include the extra compose file, and all the values are set right.
# StatsD (CURRENTLY NOT SUPPORTED)
# -------------------------------
ammaratef45 marked this conversation as resolved Outdated

Same with host and port, since es is the host name in the compose file and I'm assuming 9200 is the port configured for the image docker.elastic.co/elasticsearch/elasticsearch-oss?

Same with host and port, since `es` is the host name in the compose file and I'm assuming 9200 is the port configured for the image `docker.elastic.co/elasticsearch/elasticsearch-oss`?

34
compose.elasticsearch.yml Normal file
View File

@ -0,0 +1,34 @@
---
version: "3.8"
services:
es:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "cluster.name=es-mastodon"
- "discovery.type=single-node"
- "bootstrap.memory_lock=true"
networks:
- internal
volumes:
- es:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
app:
environment: &es-env
- "ES_ENABLED=true"
- "ES_HOST=es"
- "ES_PORT=9200"
streaming:
environment: *es-env
sidekiq:
environment: *es-env
volumes:
es:

View File

@ -185,22 +185,6 @@ services:
volumes:
- redis:/data
es:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.2
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "cluster.name=es-mastodon"
- "discovery.type=single-node"
- "bootstrap.memory_lock=true"
networks:
- internal
volumes:
- es:/usr/share/elasticsearch/data
ulimits:
memlock:
soft: -1
hard: -1
secrets:
secret_key_base:
name: ${STACK_NAME}_secret_key_base_${SECRET_SECRET_KEY_BASE_VERSION}
@ -231,7 +215,6 @@ volumes:
app:
redis:
postgres:
es:
networks:
internal: