azukiapp/deploy-digitalocean
Base docker image to deploy an app into DigitalOcean using `azk` (http://azk.io)
1.0K
Base docker image to deploy an app into DigitalOcean using azk
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.
The following environment variables are available for configuring the deployment using this image:
$AZK_MID || azk-deploy
): Droplet name;true
, enables DigitalOcean built-in backups;true
, enables DigitalOcean built-in private networking;/azk/deploy/.config
): Path to be mapped as a persistent folder on Azkfile.js. Used to cache deploy information;REMOTE_USER
/REMOTE_PROJECT_PATH_ID
(i.e., REMOTE_PROJECT_PATH
) in the remote server. If no value is given, a random id will be generated;REMOTE_USER
/REMOTE_PROJECT_PATH_ID
;.env
): The .env file
path that will be copied to remote server;Usage
Consider you want to deploy your app into DigitalOcean and your local .ssh keys are placed at LOCAL_DOT_SSH_PATH
(usually this path is $HOME
/.ssh).
Usage with azk
Example of using this image with azk:
deploy
system to your Azkfile.js:/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
// ...
deploy: {
image: {"docker": "azukiapp/deploy-digitalocean"},
mounts: {
"/azk/deploy/src": path("."),
"/azk/deploy/.ssh": path("#{env.HOME}/.ssh"),
"/azk/deploy/.config": persistent("deploy-config"),
},
scalable: {"default": 0, "limit": 0},
},
});
HOST_DOMAIN
(if any) and HOST_IP
var to your main system http domains (so you can access it by http://SERVER_PUBLIC_IP
or http://YOUR_CUSTOM_DOMAIN
). Please note the order matter./**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
example: {
// ...
http: {
domains: [
// ...
"#{env.HOST_DOMAIN}",
"#{env.HOST_IP}"
]
},
},
// ...
});
.env
file:$ echo DEPLOY_API_TOKEN=PUT_YOUR_TOKEN_HERE >> .env
$ azk deploy
AZK_RESTART_COMMAND
for a specific deploy:$ azk deploy -e AZK_RESTART_COMMAND="azk restart -R -vvvv --rebuild"
Usage with docker
To create the image azukiapp/deploy-digitalocean
, execute the following command on the deploy-digitalocean image folder:
$ docker build -t azukiapp/deploy-digitalocean latest
To run the image:
$ docker run --rm --name deploy-digitalocean-run \
-v $(pwd):/azk/deploy/src \
-v $HOME/.ssh:/azk/deploy/.ssh \
-e "DEPLOY_API_TOKEN=`DIGITALOCEAN_API_TOKEN`" \
azukiapp/deploy-digitalocean
Before running, replace DIGITALOCEAN_API_TOKEN
with the actual value.
Azuki Dockerfiles distributed under the Apache License.
docker pull azukiapp/deploy-digitalocean