Skip to content

Instantly share code, notes, and snippets.

@chasseurmic
Created January 20, 2015 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chasseurmic/19a41b85ead855416d27 to your computer and use it in GitHub Desktop.
Save chasseurmic/19a41b85ead855416d27 to your computer and use it in GitHub Desktop.
Rake tasks for building and deploying Rails app
namespace :docker do
desc "Remove docker container"
task :clean do
sh './clean.sh'
end
desc "Build Docker image"
task :build => [:clean] do
sh 'docker build -t localhost:5000/username/repo_name .'
end
desc "Run Docker image"
task :run => [:clean] do
sh 'docker run --name repo_name -p host_port:container_port -d localhost:5000/username/repo_name'
end
desc "Deploy Docker image"
task :deploy => [:build] do
sh './deploy.sh'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment