Selvamraju007/elastic-docker ? reverse-engineered prompt

Reverse engineered prompt

Build me a Docker Compose setup for the Elastic Stack that spins up Elasticsearch, Kibana, Logstash, Filebeat, and APM with security turned on by default. I want it to start with a single command, use environment variables from a .env file for things like passwords and heap sizes, and keep data, keystore, and self signed certs persisted so the stack survives restarts.

It should be ready to run as a production style single node setup, but also make it easy to add a couple extra Elasticsearch nodes for experimenting. Please include monitoring, basic tooling, and a way to collect Docker container logs into Elasticsearch. Kibana should come up on HTTPS, and the setup should make it clear how to initialize everything first, then start the stack, then bring it down or reset it if needed.

If anything is unclear, look up the current Elastic docs online and align the config with the official images.