Add extra-settings script
This script is designed to simplify the configuration of the Docker environment and related settings. The primary tasks it addresses are:
-
Docker Container IP Address:
- Adds the container's IP address to the /etc/hosts file for convenient access.
-
Opening Port 9003 for Xdebug:
- Provides the option to open port 9003 for Xdebug.
-
Increasing Virtual Memory Map Count for Elasticsearch:
- Allows increasing the virtual memory map count for Elasticsearch if needed.
User Instructions:
-
Execute the script to perform the necessary configurations.
-
Follow the prompts and choose options according to your preferences.
-
Verify that all tasks have been completed successfully.
Please feel free to reach out if you have any questions or suggestions for improving the script.
PR Summary
-
New Configuration Script for Linux Users A fresh script has been included, specifically designed for Linux users. This script performs several tasks, including verifying if the user is operating on a Linux-based system, acquiring the IP address automatically from any running Docker container, and updating the '
/etc/hosts' file appropriately. It further guides the user to unlock port 9003 for Xdebug operations and ultimately confirms successful completion with a message. -
Enhanced Virtual Memory Allocation In the
compose/compose.yamlfile, a few adjustments have been made to boost the virtual memory map count. By unlocking themax_map_count=262144line, we've expanded the virtual memory allocation for bothopensearchandelasticsearchsystems, which will potentially improve performance.
I like the ideas in this PR. However, I don't really like how this is in a non-descript "extra-settings" file. It feels a bit out of place & random.
Does it make sense to rename this to bin/configure-linux? I think the host.docker.internal ip is automatically taken care of for you in macOS, and the iptables command doesn't exist (or is needed) on mac. This would also open up this script for possible future enhancements that are specific to Linux.
And I don't think we need the elasticsearch command at all, because I think we can set this memory param as an environment variable at https://github.com/markshust/docker-magento/blob/master/compose/compose.yaml#L63. If so, it would make sense to just add this max_map_count prop as a commented-out setting under that environment property right in the compose.yaml file, along with a comment-out description for what it does.
Hi, Mark!
Thank you for your feedback. Good idea!
-
I've renamed the script name from
bin/extra-settingstobin/configure-linux, and modified the script. -
I've added the
max_map_countparameter for Elasticsearch and OpenSearch with comments to thecompose.yamlfile.
I made a few updates to make the script more portable, consistent with the logic within other scripts, and simplify the logic.