azukiapp/deploy
Base docker image to deploy an app using `azk` (http://azk.io)
1.1K
Base docker image to deploy an app 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/deploy/src
) Project source code path;/azk/deploy/.ssh
): Path containing SSH keys. If no path is given, a new SSH public/private key pair will be generated;/azk/deploy/.config
): Path to be mapped as a persistent folder on Azkfile.js. Used to cache deploy information;REMOTE_USER
's password. If it's a new user, a random password will be generated;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;id_rsa
): The SSH private key filename that will be used to generate and/or connect to the droplet. The public key is considered SSH_PRIVATE_KEY_FILE.pub
.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:
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"},
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`",
},
},
});
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}"
]
},
},
// ...
});
$ 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
, 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.
Azuki Dockerfiles distributed under the Apache License.
docker pull azukiapp/deploy