Skip to content

feat(service): add elasticsearch template #6300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

Slawikus
Copy link

@Slawikus Slawikus commented Aug 1, 2025

Changes

  • feat(service): add elasticsearch template

@Slawikus
Copy link
Author

Slawikus commented Aug 1, 2025

Its my first template submission so any suggestions are welcomed!

@Cinzya Cinzya added the ⚙️ Service Issues requesting or PRs adding/fixing service templates. label Aug 3, 2025
image: docker.elastic.co/elasticsearch/elasticsearch-wolfi:8.19.0
environment:
- SERVICE_FQDN_ELASTICSEARCH_9200
- ELASTIC_PASSWORD=${SERVICE_PASSWORD_ELASTICSEARCH}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If possible also autogenerate the username

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it seems its not possible via env vars for this docker image, it only creates a default user elastic. one can configure users later, but not via env vars on the docker image setup.

environment:
- SERVICE_FQDN_ELASTICSEARCH_9200
- ELASTIC_PASSWORD=${SERVICE_PASSWORD_ELASTICSEARCH}
- ES_JAVA_OPTS=-Xms512m -Xmx512m # memory set to 512MB
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this should be adjustable by the user or if it's correct as is. It looks a bit weird to me probably we do not need -Xmx512m 2 times?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It comes from here https://www.elastic.co/docs/deploy-manage/deploy/self-managed/install-elasticsearch-docker-prod#docker-set-heap-size - basically I did it with the idea that most of Coolify users would run it on relatively small VPS boxes, and I didn't want that ES would take a lot of memory as it would do otherwise.

I guess some users would be willing to configure this afterwards, but this is advanced case so I guess people who know what they are doing would dig into ES docs and set needed env vars as they need it. Or should I set it something like: ES_JAVA_OPTS=${ES_JAVA_OPTS:-"-Xms512m -Xmx512m"} not sure though if it'll work with the string here.

And its not 2 times, those are two different values, one with ms and one with mx in it :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this setting Elasticsearch eats a ton of RAM, basically half of what is available. I faced this problem on one of my servers, and don't want that people will get into this issue as well.

@peaklabs-dev peaklabs-dev added the 💤 Waiting for changes PRs awaiting changes from the author. label Aug 11, 2025
@peaklabs-dev peaklabs-dev changed the title Add Elasticsearch service template feat(service): add elasticsearch template Aug 11, 2025
@Slawikus
Copy link
Author

More general question I have - some people want to run ES as a public web service (for example so that frontend can directly pull data from it), but some users want to run it in the internal project network so that only backend services can access it (like one runs PG or Redis). But I don't know how one can configure this, and secondly, if one cannot configure that, I don't even know what is the right place to add those kind of the comments so that at least users are aware of this. Any hints?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Service Issues requesting or PRs adding/fixing service templates. 💤 Waiting for changes PRs awaiting changes from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants