{"id":23635199,"url":"https://github.com/interactive-pioneers/capistrano-docker-compose","last_synced_at":"2025-08-31T11:30:47.882Z","repository":{"id":59151841,"uuid":"46803716","full_name":"interactive-pioneers/capistrano-docker-compose","owner":"interactive-pioneers","description":"Docker Compose specific tasks for Capistrano","archived":false,"fork":false,"pushed_at":"2017-10-02T10:51:33.000Z","size":61,"stargazers_count":17,"open_issues_count":13,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-12-15T22:49:10.431Z","etag":null,"topics":["capistrano","deployment","docker","docker-compose","haproxy","ruby","rubygem"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/capistrano-docker-compose","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interactive-pioneers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-24T16:21:55.000Z","updated_at":"2021-12-01T13:18:12.000Z","dependencies_parsed_at":"2022-09-13T10:50:28.472Z","dependency_job_id":null,"html_url":"https://github.com/interactive-pioneers/capistrano-docker-compose","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-pioneers%2Fcapistrano-docker-compose","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-pioneers%2Fcapistrano-docker-compose/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-pioneers%2Fcapistrano-docker-compose/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interactive-pioneers%2Fcapistrano-docker-compose/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interactive-pioneers","download_url":"https://codeload.github.com/interactive-pioneers/capistrano-docker-compose/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231590304,"owners_count":18396921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capistrano","deployment","docker","docker-compose","haproxy","ruby","rubygem"],"created_at":"2024-12-28T05:31:48.056Z","updated_at":"2024-12-28T05:31:48.751Z","avatar_url":"https://github.com/interactive-pioneers.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Capistrano::Docker::Compose [![Build Status](https://travis-ci.org/interactive-pioneers/capistrano-docker-compose.svg?branch=master)](https://travis-ci.org/interactive-pioneers/capistrano-docker-compose) [![Gem Version](https://badge.fury.io/rb/capistrano-docker-compose.svg)](https://badge.fury.io/rb/capistrano-docker-compose)\n\nDocker Compose specific tasks for Capistrano allowing seamless zero downtime containerised deployments.\n\n## Minimum requirements\n\n- Capistrano 3.5\n- Docker Engine 1.11\n- Docker Compose 1.7\n- HAProxy 1.6\n\n## Supported databases\n\n| Database    | Versions tested |\n| --------    | --------------- |\n| PostgreSQL  | 9.5             |\n| MariaDB     | 5.5, 10.1       |\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'capistrano-docker-compose'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install capistrano-docker-compose\n\n## Usage\n\n1. Create Docker Compose descriptors for each environment leaving `docker-compose.yml` as default for development environment, e.g.:\n\n  - `docker-compose.yml`\n  - `docker-compose-staging.yml`\n  - `docker-compose-production.yml`\n\n2. Make Compose YAML with `web` service (name is conventional) using following environment variables:\n\n  - `CAP_DOCKER_COMPOSE_ROOT_PATH` for shared path\n  - `CAP_DOCKER_COMPOSE_PORT` for port range\n\n3. 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](https://github.com/interactive-pioneers/capistrano-docker-compose/blob/master/docker-compose-staging.example.yml).\n\n4. Add `capistrano-docker-compose` to `Capfile`:\n\n    ``` ruby\n    # Capfile\n    require 'capistrano/docker/compose'\n    ```\n\n5. Configure following Docker Compose specific options in `config/deploy.rb` and/or `config/deploy/\u003cenvironment\u003e.rb`:\n\n    ```ruby\n    # Define port range in respect to load balancer on server\n    # If 2 or more environments reside on same server, configure port range as per environment\n    # Ruby's Range object is expected, see http://ruby-doc.org/core-2.3.0/Range.html\n    # Example: set :docker_compose_port_range, 2070..2071\n    set :docker_compose_port_range, \u003cport\u003e..\u003cport\u003e\n\n    # OPTIONAL\n    # User name when running the Docker image (reflecting Docker's USER instruction)\n    # Example: set :docker_compose_user, 'pioneer'\n    set :docker_compose_user, '\u003cusername\u003e'\n\n    # OPTIONAL\n    # Roles considered\n    # Defaults to :all\n    # Example: set :docker_compose_roles, :web\n    set :docker_compose_roles, \u003croles\u003e\n    ```\n\n6. Configure HAProxy load balancer with port range defined in `docker_compose_port_range`, see [example configuration](https://github.com/interactive-pioneers/capistrano-docker-compose/blob/master/haproxy.example.cfg).\n\n  NB! Ensure load balancer's HTTP health check uses Layer 7 and corresponds to the needs of the particular application.\n\n### PHP projects\n\nTo use `capistrano-docker-compose` on PHP project, such as Wordpress or Drupal:\n\n1. Add `Gemfile` to project root:\n\n\t```ruby\n\t# Gemfile\n\tsource 'https://rubygems.org'\n\n\tgroup :capistrano do\n\t\tgem 'capistrano-bundler'\n\t\tgem 'capistrano-docker-compose'\n\tend\n\t```\n2. Run `bundle` to install\n\nIf bundling is not desired during deployment (no RubyGems dependencies), Capistrano flow can be altered by removing bundler task:\n\n```ruby\n# config/deploy.rb\nnamespace :deploy do\n  Rake::Task[\"bundler:install\"].clear_actions\nend\n```\n\n## Contributing\n\nBug 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](http://contributor-covenant.org) code of conduct.\n\n## Licence\n\nCopyright © 2016, 2017 Ain Tohvri, Interactive Pioneers GmbH. Licenced under [GPL-3](https://github.com/interactive-pioneers/capistrano-docker-compose/blob/master/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractive-pioneers%2Fcapistrano-docker-compose","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finteractive-pioneers%2Fcapistrano-docker-compose","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finteractive-pioneers%2Fcapistrano-docker-compose/lists"}