Use kamal network for containers

Create a `kamal` network for the proxy and app containers to run in.
This allows the proxy to refer to the app containers by name.
This commit is contained in:
Donal McBreen
2024-03-20 09:26:00 +00:00
parent 9c4747ec0c
commit 00061ce7aa
16 changed files with 51 additions and 50 deletions

View File

@@ -4,7 +4,7 @@ class CliProxyTest < CliTestCase
test "boot" do
run_command("boot").tap do |output|
assert_match "docker login", output
assert_match "docker run --name mproxy --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --log-opt max-size=\"10m\" #{Kamal::Commands::Proxy::DEFAULT_IMAGE}", output
assert_match "docker run --name mproxy --detach --restart unless-stopped --network kamal --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --log-opt max-size=\"10m\" #{Kamal::Commands::Proxy::DEFAULT_IMAGE}", output
end
end
@@ -14,7 +14,7 @@ class CliProxyTest < CliTestCase
run_command("reboot").tap do |output|
assert_match "docker container stop mproxy", output
assert_match "docker container prune --force --filter label=org.opencontainers.image.title=mproxy", output
assert_match "docker run --name mproxy --detach --restart unless-stopped --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --log-opt max-size=\"10m\" #{Kamal::Commands::Proxy::DEFAULT_IMAGE}", output
assert_match "docker run --name mproxy --detach --restart unless-stopped --network kamal --publish 80:80 --volume /var/run/docker.sock:/var/run/docker.sock --log-opt max-size=\"10m\" #{Kamal::Commands::Proxy::DEFAULT_IMAGE}", output
end
end