Last active
August 29, 2015 14:16
-
-
Save heitortsergent/a23c4468c13af0ee37c3 to your computer and use it in GitHub Desktop.
Azkfile.js Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Adds the systems that shape your system | |
systems({ | |
'node-example': { | |
// Dependent systems | |
depends: ["db"], | |
// More images: http://registry.hub.docker.com | |
image: { docker: "azukiapp/nodejs:0.12" }, | |
// Steps to execute before running instances | |
provision: [ | |
"npm install", | |
], | |
workdir: "/azk/#{manifest.dir}", | |
command: "node index.js", | |
mounts: { | |
// Mounts folders to assigned paths | |
"/azk/#{manifest.dir}": path("."), | |
}, | |
// Start with 2 instances | |
scalable: { default: 2}, | |
// Set hostname to use in http balancer | |
http: { | |
// node-example.dev.azk.io | |
domains: [ "#{system.name}.#{azk.default_domain}" ], | |
}, | |
envs: { | |
// Exports global variables | |
NODE_ENV: "dev", | |
}, | |
}, | |
db: { | |
image: { docker: "azukiapp/mysql" }, | |
mounts: { | |
// Activates a persistent data folder in '/data' | |
"/data": persistent("data-#{system.name}"), | |
}, | |
ports: { | |
data: "3306/tcp", | |
}, | |
envs: { | |
MYSQL_USER: "admin", | |
MYSQL_PASS: "password", | |
}, | |
export_envs: { | |
DATABASE_URL: | |
"mysql://#{envs.MYSQL_USER}:#{envs.MYSQL_PASS}@#{net.host}:#{net.port.data}/", | |
}, | |
}, | |
}); | |
// Sets a default system (to use: start, stop, status, scale) | |
setDefault("node-example") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment