Skip to content

Conversation

@thibaudcolas
Copy link
Member

Fixes #3. I chose to keep it simple and leave the service in the same compose file.

Comment on lines +58 to +59
- xpack.security.enabled=false
- discovery.type=single-node
Copy link
Member Author

Choose a reason for hiding this comment

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

This is to simplify accessing / running locally (single node, no security). I’ve copy-pasted this from existing projects, not sure how we arrived at those specific settings. It works.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, without xpack.security.enabled=false the Elasticsearch server will reject requests from the Django server process because Elasticsearch requires HTTPS by default. I ran into this while working on wagtail/wagtail#12862 yesterday: https://stackoverflow.com/questions/71492404

I also use discovery.type=single-node per the example in https://hub.docker.com/_/elasticsearch, but I haven't tried if it works without that.

The Elasticsearch GitHub Action we use in Wagtail's CI has a few more parameters, including both we set here: https://github.com/getong/elasticsearch-action/blob/v1.3/entrypoint.sh#L7

Copy link
Member

@laymonage laymonage left a comment

Choose a reason for hiding this comment

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

Would be nice to also get the requirements automatically installed somehow, but I think this is a good first step!

Comment on lines +58 to +59
- xpack.security.enabled=false
- discovery.type=single-node
Copy link
Member

Choose a reason for hiding this comment

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

Yes, without xpack.security.enabled=false the Elasticsearch server will reject requests from the Django server process because Elasticsearch requires HTTPS by default. I ran into this while working on wagtail/wagtail#12862 yesterday: https://stackoverflow.com/questions/71492404

I also use discovery.type=single-node per the example in https://hub.docker.com/_/elasticsearch, but I haven't tried if it works without that.

The Elasticsearch GitHub Action we use in Wagtail's CI has a few more parameters, including both we set here: https://github.com/getong/elasticsearch-action/blob/v1.3/entrypoint.sh#L7

@thibaudcolas thibaudcolas merged commit 31d7990 into wagtail:main Feb 18, 2025
1 check passed
@thibaudcolas thibaudcolas deleted the es-service branch February 18, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add optional Elasticsearch service to docker-compose configuration

2 participants