Pārlūkot izejas kodu

Merge pull request #1016 from YevhenZvieriev/feature/extra-settings

Add extra-settings script
Mark Shust 1 gadu atpakaļ
vecāks
revīzija
69f29dea57
2 mainītis faili ar 30 papildinājumiem un 0 dzēšanām
  1. 26 0
      compose/bin/configure-linux
  2. 4 0
      compose/compose.yaml

+ 26 - 0
compose/bin/configure-linux

@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+if [ "$(uname)" == "Darwin" ]; then
+    echo "This script is designed for Linux and will not work properly on macOS."
+else
+    # Get the IP address from the Docker container
+    docker_ip=$(docker run --rm alpine ip route | awk 'NR==1 {print $3}')
+
+    # Check if the IP address already exists in /etc/hosts
+    if grep -q "$docker_ip host.docker.internal" /etc/hosts; then
+        echo "The entry already exists in /etc/hosts. No action needed."
+    else
+        # Add a new entry to /etc/hosts
+        echo "$docker_ip host.docker.internal" | sudo tee -a /etc/hosts
+        echo "A new entry in the /etc/hosts file has been created"
+    fi
+
+    # Ask the user whether to execute the iptables command
+    read -r -p "Do you want to open port 9003 for Xdebug? (y/n): " choice
+    if [ "$choice" == "y" ]; then
+        sudo iptables -A INPUT -p tcp --dport 9003 -j ACCEPT
+        echo "Port 9003 has been opened for xdebug."
+    fi
+
+    echo "Tasks completed successfully"
+fi

+ 4 - 0
compose/compose.yaml

@@ -66,6 +66,8 @@ services:
       ## More info at https://github.com/markshust/docker-magento/issues/488
       - "cluster.routing.allocation.disk.threshold_enabled=false"
       - "index.blocks.read_only_allow_delete"
+      ## Uncomment the following line to increase the virtual memory map count
+  #   - "max_map_count=262144"
 
   ## If you wish to use Elasticsearch, comment out opensearch image above and
   ## uncomment this block. Do the same in the composer.healthcheck.yaml file.
@@ -84,6 +86,8 @@ services:
   #    ## More info at https://github.com/markshust/docker-magento/issues/488
   #    - "cluster.routing.allocation.disk.threshold_enabled=false"
   #    - "index.blocks.read_only_allow_delete"
+  #    ## Uncomment the following line to increase the virtual memory map count
+  #    - "max_map_count=262144"
 
   rabbitmq:
     image: markoshust/magento-rabbitmq:3.11-1