Merge pull request #861 from K4sku/update-docker-setup-sample-hook

Expand on docker-setup.sample hook
This commit is contained in:
Donal McBreen
2024-06-25 14:44:13 +01:00
committed by GitHub

View File

@@ -1,7 +1,13 @@
#!/bin/sh
#!/usr/bin/env ruby
# A sample docker-setup hook
#
# Sets up a Docker network which can then be used by the applications containers
# Sets up a Docker network on defined hosts which can then be used by the applications containers
ssh user@example.com docker network create kamal
hosts = ENV["KAMAL_HOSTS"].split(",")
hosts.each do |ip|
destination = "root@#{ip}"
puts "Creating a Docker network \"kamal\" on #{destination}"
`ssh #{destination} docker network create kamal`
end