azukiapp / docker-deploy

Easily deploy your app to a remote server using azk
Apache License 2.0
9 stars 4 forks source link

azukiapp/deploy

Base docker image to deploy an app using azk

Initial Considerations

We strongly recommend you to use Ubuntu 14.04 x86-64 in the target server. Using this image with any other OS in the target server is untested yet and it's potentially broken.

Versions (tags)

- [`latest`](https://github.com/azukiapp/docker-deploy/blob/master/latest/Dockerfile) - [`0.0.7`](https://github.com/azukiapp/docker-deploy/blob/v0.0.7/latest/Dockerfile) - [`0.0.6`](https://github.com/azukiapp/docker-deploy/blob/v0.0.6/latest/Dockerfile) - [`0.0.5`](https://github.com/azukiapp/docker-deploy/blob/v0.0.5/latest/Dockerfile) - [`0.0.4`](https://github.com/azukiapp/docker-deploy/blob/v0.0.4/latest/Dockerfile) - [`0.0.3`](https://github.com/azukiapp/docker-deploy/blob/v0.0.3/latest/Dockerfile) - [`0.0.2`](https://github.com/azukiapp/docker-deploy/blob/v0.0.2/latest/Dockerfile) - [`0.0.1`](https://github.com/azukiapp/docker-deploy/blob/v0.0.1/latest/Dockerfile)

Image content:

Configuration

The following environment variables are available for configuring the deployment using this image:

Usage

Consider you want to deploy your app in a server which public IP is SERVER_PUBLIC_IP and root user's password is SERVER_ROOT_PASS, and your local SSH keys are placed at LOCAL_DOT_SSH_PATH (usually this path is $HOME/.ssh). Remember that passing a root password is optional, since you can always put your local SSH public key into $HOME/.ssh/authorized_keys file in the host server.

Usage with azk

Example of using this image with azk:

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */

// Adds the systems that shape your system
systems({
  // ...

  deploy: {
    image: {"docker": "azukiapp/deploy"},
    mounts: {
      "/azk/deploy/src":     path("."),
      "/azk/deploy/.ssh":    path("#{env.HOME}/.ssh"),
      "/azk/deploy/.config": persistent("deploy-config"),
    },
    scalable: {"default": 0, "limit": 0},
    envs: {
      REMOTE_HOST:        "`SERVER_PUBLIC_IP`",
      REMOTE_ROOT_PASS:   "`SERVER_ROOT_PASS`",
    },
  },
});
/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */

// Adds the systems that shape your system
systems({
  example: {
    // ...
    http: {
      domains: [
        // ...
        "#{env.HOST_DOMAIN}",
        "#{env.HOST_IP}"
      ]
    },
  },

  // ...
});

Usage with docker

To create the image azukiapp/deploy, execute the following command on the deploy image folder:

$ docker build -t azukiapp/deploy .

To run the image:

$ docker run --rm --name deploy-run \
  -v $(pwd):/azk/deploy/src \
  -v $HOME/.ssh:/azk/deploy/.ssh \
  -e "REMOTE_HOST=`SERVER_PUBLIC_IP`" \
  -e "REMOTE_ROOT_PASS=`SERVER_ROOT_PASS`" \
  azukiapp/deploy

Before running, replace SERVER_PUBLIC_IP and SERVER_ROOT_PASS with the actual values.

License

Azuki Dockerfiles distributed under the Apache License.