Dockerploy

Deploy dockerized an application Build Status

Installation

Add this line to your application's Gemfile:

    group :development do
      gem 'dockerploy'
    end

And then execute:

$ bundle

Or install it yourself as:

$ gem install dockerploy

Generate an empty docker/config.yml with:

$ bundle exec dockerploy init

Configuration

In docker/config.yml.

image_name: <Docker image name>
docker_username: <Docker registry server username>
docker_host: <Docker server for building>
application_name: <application name>
staging: # Environment name
  env_file: docker/environments/staging.yml # Environment variable file path
  tag: v1.0.7 # <Image tag>
  hooks:
    before_deploy:
      - local:
        - <Command to run in local machine>
      - remote:
        - <Command to run in remove machine(host server)>
    after_deploy:
      - local:
        - <Command to run in local machine>
      - remote:
        - <Command to run in remove machine(host server)>
  volumes:
    - volume:
        host: <Folder from the host>
        guest: <Folder to the container>
  servers:
    - host: <Docker server>
      username: <Server username>
      password: <Server password>
      port: <Server SSH port>
      custom_variables:
        role: <Server SSH port>
      container:
        host: <Container host>
        ssh_port: <Container ssh port for mapping>
        http_port: <Container http port for mapping>

Usage

To build an image

dockerploy build

To push an image

dockerploy push

To pull an image on server

dockerploy pull staging

To deploy an application

dockerploy deploy staging

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request