Commit 1ce7b5cf by Tsubasa Namiki

Fixed provision: reduce dependence

parent 5d458b12
...@@ -7,6 +7,11 @@ execute "install docker-compose" do ...@@ -7,6 +7,11 @@ execute "install docker-compose" do
not_if "test -e /usr/local/bin/docker-compose" not_if "test -e /usr/local/bin/docker-compose"
end end
link "/usr/bin/docker-compose" do
to "/usr/local/bin/docker-compose"
not_if "test -e /usr/bin/docker-compose"
end
service "docker" do service "docker" do
action [:enable, :start] action [:enable, :start]
end end
include_recipe "../cookbooks/docker/default.rb" include_recipe "../cookbooks/docker/default.rb"
execute "add group docker for ec2-user" do directory "/dockerfile"
command "gpasswd -a ec2-user docker" directory "/dockerfile/restyaboard"
not_if "id ec2-user | grep docker" remote_directory "/dockerfile/restyaboard" do
action :create
source "../../restyaboard"
end end
git "/home/ec2-user/docker-restyaboard" do remote_file "/dockerfile/docker-compose.yml" do
repository "https://github.com/namikingsoft/docker-restyaboard.git" source "../../docker-compose.yml"
user "ec2-user"
not_if "test -d /home/ec2-user/docker-restyaboard"
end end
execute "docker up" do execute "docker up" do
command "COMPOSE_API_VERSION=1.18 /usr/local/bin/docker-compose up -d" command "COMPOSE_API_VERSION=1.18 docker-compose up -d"
cwd "/home/ec2-user/docker-restyaboard" cwd "/dockerfile"
user "ec2-user"
not_if "docker ps | grep restyaboard" not_if "docker ps | grep restyaboard"
end end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment