Merge pull request #1050 from tiramizoo/template-docker-setup

Update sample template for docker setup hook.
This commit is contained in:
David Heinemeier Hansson
2024-10-05 01:46:09 +02:00
committed by GitHub

View File

@@ -1,13 +1,3 @@
#!/usr/bin/env ruby
#!/bin/sh
# A sample docker-setup hook
#
# Sets up a Docker network on defined hosts which can then be used by the applications containers
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
echo "Docker set up on $KAMAL_HOSTS..."