fix: host directory mounts for editable config (/opt/fw/{name}/)

This commit is contained in:
admin 2026-08-03 16:58:52 +00:00
parent 9d10516a63
commit 3d8b85d918

View file

@ -54,6 +54,10 @@ def deploy_container(name, token, cloud, port, upstream_ip, upstream_port, label
container = f"wallarm-{name}" container = f"wallarm-{name}"
run(f"docker rm -f {container} 2>/dev/null", timeout=10) run(f"docker rm -f {container} 2>/dev/null", timeout=10)
host_dir = f"{BASE}/{name}"
os.makedirs(f"{host_dir}/etc", exist_ok=True)
os.makedirs(f"{host_dir}/nginx", exist_ok=True)
# Run container # Run container
monitoring_port = int(port) + 10 monitoring_port = int(port) + 10
print(f"[{name}] Starting container on port {port}...") print(f"[{name}] Starting container on port {port}...")
@ -61,7 +65,7 @@ def deploy_container(name, token, cloud, port, upstream_ip, upstream_port, label
--name {container} \ --name {container} \
--restart unless-stopped \ --restart unless-stopped \
-p {port}:{port} \ -p {port}:{port} \
-v wallarm-data-{name}:/opt/wallarm \ -v {host_dir}/nginx:/etc/nginx -v {host_dir}/etc:/opt/wallarm/etc \
-p {monitoring_port}:{monitoring_port} \ -p {monitoring_port}:{monitoring_port} \
-e WALLARM_API_TOKEN={token} \ -e WALLARM_API_TOKEN={token} \
-e WALLARM_API_HOST={api_host} \ -e WALLARM_API_HOST={api_host} \