revised approach
This commit is contained in:
21
setup-network.sh
Executable file
21
setup-network.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Create shared network for Traefik and all services
|
||||
NETWORK_NAME="traefik"
|
||||
|
||||
echo "Setting up Docker network: $NETWORK_NAME"
|
||||
|
||||
# Check if network already exists
|
||||
if docker network ls | grep -q "$NETWORK_NAME"; then
|
||||
echo "Network $NETWORK_NAME already exists"
|
||||
else
|
||||
# Create the network with a specific subnet to ensure consistency
|
||||
docker network create \
|
||||
--driver bridge \
|
||||
--subnet=172.20.0.0/16 \
|
||||
--gateway=172.20.0.1 \
|
||||
"$NETWORK_NAME"
|
||||
fi
|
||||
|
||||
echo "Network details:"
|
||||
docker network inspect "$NETWORK_NAME" | grep -E "(Name|Subnet|Gateway)"
|
||||
Reference in New Issue
Block a user