feat: script auto-migrates old docker-compose ports to host network mode on update
This commit is contained in:
parent
af5cfbea84
commit
a0edaccfc4
1 changed files with 11 additions and 0 deletions
11
install.sh
11
install.sh
|
|
@ -342,6 +342,17 @@ do_update() {
|
||||||
$dc pull
|
$dc pull
|
||||||
log_ok "Image pulled."
|
log_ok "Image pulled."
|
||||||
|
|
||||||
|
# Update older configs to use network_mode: "host"
|
||||||
|
if grep -q 'ports:' docker-compose.yml && grep -q '80:80' docker-compose.yml; then
|
||||||
|
log_step "Updating docker-compose.yml to use host network mode..."
|
||||||
|
sed -i 's/ports:/network_mode: "host"/g' docker-compose.yml
|
||||||
|
sed -i '/80:80/d' docker-compose.yml
|
||||||
|
sed -i '/81:81/d' docker-compose.yml
|
||||||
|
sed -i '/443:443/d' docker-compose.yml
|
||||||
|
sed -i '/51820-51830:51820-51830\/udp/d' docker-compose.yml
|
||||||
|
log_ok "docker-compose.yml updated."
|
||||||
|
fi
|
||||||
|
|
||||||
log_step "Recreating containers..."
|
log_step "Recreating containers..."
|
||||||
$dc up -d
|
$dc up -d
|
||||||
log_ok "D3V-NPMWG updated."
|
log_ok "D3V-NPMWG updated."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue