All Projects → interactive-pioneers → capistrano-docker-compose

interactive-pioneers / capistrano-docker-compose

Licence: GPL-3.0 license
Docker Compose specific tasks for Capistrano

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to capistrano-docker-compose

Kanary
Kubernetes Operator to manage canary deployment using HAProxy
Stars: ✭ 14 (-17.65%)
Mutual labels:  deployment, haproxy
Capistrano
Remote multi-server automation tool
Stars: ✭ 12,035 (+70694.12%)
Mutual labels:  deployment, capistrano
Rails
Official Ruby on Rails specific tasks for Capistrano
Stars: ✭ 773 (+4447.06%)
Mutual labels:  deployment, capistrano
Shipit
Universal automation and deployment tool ⛵️
Stars: ✭ 5,249 (+30776.47%)
Mutual labels:  deployment, capistrano
dkdeploy-typo3-cms
dkdeploy-typo3-cms provides functionality for fully automated deployments targeting TYPO3 CMS applications
Stars: ✭ 16 (-5.88%)
Mutual labels:  rubygem, capistrano
Deploy
Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style
Stars: ✭ 2,141 (+12494.12%)
Mutual labels:  deployment, capistrano
Hapistrano
Deploy tool for Haskell applications, like Capistrano for Rails
Stars: ✭ 91 (+435.29%)
Mutual labels:  deployment, capistrano
capistrano-uberspace
Deploy your rails app on an uberspace with Capistrano 3
Stars: ✭ 14 (-17.65%)
Mutual labels:  deployment, capistrano
Procsd
Manage your application processes in production hassle-free like Heroku CLI with Procfile and Systemd
Stars: ✭ 181 (+964.71%)
Mutual labels:  deployment, capistrano
Cape
Dynamically generates Capistrano recipes for Rake tasks
Stars: ✭ 178 (+947.06%)
Mutual labels:  deployment, capistrano
capistrano-chewy
Chewy tasks and Elasticsearch indexes management with Capistrano
Stars: ✭ 14 (-17.65%)
Mutual labels:  deployment, capistrano
ansible-rails-deployment
deploy projects using ansible
Stars: ✭ 77 (+352.94%)
Mutual labels:  deployment, capistrano
strings-truncation
Truncate strings with fullwidth characters and ANSI codes.
Stars: ✭ 45 (+164.71%)
Mutual labels:  rubygem
fastai-docker-deploy
Deploy fastai models with Docker
Stars: ✭ 19 (+11.76%)
Mutual labels:  deployment
sclblpy
Python package for Scailable uploads
Stars: ✭ 18 (+5.88%)
Mutual labels:  deployment
ploi-deploy-action
Deploy your application to Ploi with Github actions
Stars: ✭ 25 (+47.06%)
Mutual labels:  deployment
ml api covid
This is the API Code for my tutorial article. It paints a picture for developing a machine learning Python API from start to finish and provides help in more difficult areas like the setup with AWS Lambda.
Stars: ✭ 21 (+23.53%)
Mutual labels:  deployment
drupal-pi
Drupal on Docker on a Raspberry Pi. Pi Dramble's little brother.
Stars: ✭ 92 (+441.18%)
Mutual labels:  deployment
volkscv
A Python toolbox for computer vision research and project
Stars: ✭ 58 (+241.18%)
Mutual labels:  deployment
n65
An assembler for the 6502 microprocessor written in Ruby
Stars: ✭ 12 (-29.41%)
Mutual labels:  rubygem

Capistrano::Docker::Compose Build Status Gem Version

Docker Compose specific tasks for Capistrano allowing seamless zero downtime containerised deployments.

Minimum requirements

  • Capistrano 3.5
  • Docker Engine 1.11
  • Docker Compose 1.7
  • HAProxy 1.6

Supported databases

Database Versions tested
PostgreSQL  9.5
MariaDB 5.5, 10.1

Installation

Add this line to your application's Gemfile:

gem 'capistrano-docker-compose'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-docker-compose

Usage

  1. Create Docker Compose descriptors for each environment leaving docker-compose.yml as default for development environment, e.g.:
  • docker-compose.yml
  • docker-compose-staging.yml
  • docker-compose-production.yml
  1. Make Compose YAML with web service (name is conventional) using following environment variables:
  • CAP_DOCKER_COMPOSE_ROOT_PATH for shared path
  • CAP_DOCKER_COMPOSE_PORT for port range
  1. If you're using database service with migrations in Ruby on Rails, make sure to name database service as db (name is conventional). See also Compose YAML example.

  2. Add capistrano-docker-compose to Capfile:

    # Capfile
    require 'capistrano/docker/compose'
  3. Configure following Docker Compose specific options in config/deploy.rb and/or config/deploy/<environment>.rb:

    # Define port range in respect to load balancer on server
    # If 2 or more environments reside on same server, configure port range as per environment
    # Ruby's Range object is expected, see http://ruby-doc.org/core-2.3.0/Range.html
    # Example: set :docker_compose_port_range, 2070..2071
    set :docker_compose_port_range, <port>..<port>
    
    # OPTIONAL
    # User name when running the Docker image (reflecting Docker's USER instruction)
    # Example: set :docker_compose_user, 'pioneer'
    set :docker_compose_user, '<username>'
    
    # OPTIONAL
    # Roles considered
    # Defaults to :all
    # Example: set :docker_compose_roles, :web
    set :docker_compose_roles, <roles>
  4. Configure HAProxy load balancer with port range defined in docker_compose_port_range, see example configuration.

NB! Ensure load balancer's HTTP health check uses Layer 7 and corresponds to the needs of the particular application.

PHP projects

To use capistrano-docker-compose on PHP project, such as Wordpress or Drupal:

  1. Add Gemfile to project root:

    # Gemfile
    source 'https://rubygems.org'
    
    group :capistrano do
    	gem 'capistrano-bundler'
    	gem 'capistrano-docker-compose'
    end
  2. Run bundle to install

If bundling is not desired during deployment (no RubyGems dependencies), Capistrano flow can be altered by removing bundler task:

# config/deploy.rb
namespace :deploy do
  Rake::Task["bundler:install"].clear_actions
end

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/interactive-pioneers/capistrano-docker-compose. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

Licence

Copyright © 2016, 2017 Ain Tohvri, Interactive Pioneers GmbH. Licenced under GPL-3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].