Work out the host and port for the container

Avoid docker inspect:
1. Use the container ID as the host
2. Configure the port, default to 3000
This commit is contained in:
Donal McBreen
2024-09-10 17:47:38 +01:00
parent e9d480b514
commit 6f2eaed398
11 changed files with 28 additions and 24 deletions

View File

@@ -109,14 +109,14 @@ class CommandsProxyTest < ActiveSupport::TestCase
test "deploy" do
assert_equal \
"docker exec kamal-proxy kamal-proxy deploy service --target \"172.1.0.2:80\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\"",
new_command.deploy("service", target: "172.1.0.2:80").join(" ")
"docker exec kamal-proxy kamal-proxy deploy service --target \"172.1.0.2:3000\" --buffer-requests --buffer-responses --log-request-header \"Cache-Control\" --log-request-header \"Last-Modified\"",
new_command.deploy("service", target: "172.1.0.2").join(" ")
end
test "remove" do
assert_equal \
"docker exec kamal-proxy kamal-proxy remove service --target \"172.1.0.2:80\"",
new_command.remove("service", target: "172.1.0.2:80").join(" ")
"docker exec kamal-proxy kamal-proxy remove service --target \"172.1.0.2:3000\"",
new_command.remove("service", target: "172.1.0.2").join(" ")
end
private