Skip to content

Commit 69f29de

Browse files
authored
Merge pull request #1016 from YevhenZvieriev/feature/extra-settings
Add extra-settings script
2 parents b7b2cec + d96a4d1 commit 69f29de

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

compose/bin/configure-linux

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

compose/compose.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ services:
6666
## More info at https://github.com/markshust/docker-magento/issues/488
6767
- "cluster.routing.allocation.disk.threshold_enabled=false"
6868
- "index.blocks.read_only_allow_delete"
69+
## Uncomment the following line to increase the virtual memory map count
70+
# - "max_map_count=262144"
6971

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

8892
rabbitmq:
8993
image: markoshust/magento-rabbitmq:3.11-1

0 commit comments

Comments
 (0)