Skip to content

Instantly share code, notes, and snippets.

@gullitmiranda
Created March 17, 2016 19:32
Show Gist options
  • Select an option

  • Save gullitmiranda/3776b1d5ae505855c1c2 to your computer and use it in GitHub Desktop.

Select an option

Save gullitmiranda/3776b1d5ae505855c1c2 to your computer and use it in GitHub Desktop.
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
systems({
'app': {
depends: ['builder'],
image: {"docker": "nginx"},
workdir: "/azk/app",
shell: "/bin/bash",
mounts: {
'/azk/app/build' : persistent("./build"),
'/etc/nginx/conf.d/cdn.conf': path("./nginx.conf"),
},
http: {
domains: [ "#{system.name}.#{azk.default_domain}" ]
},
ports: {
http: "8008/tcp",
},
envs: {
// Make sure that the PORT value is the same as the one
// in ports/http below, and that it's also the same
// if you're setting it in a .env file
TERM: "xterm-256color",
},
},
'builder': {
// Dependent systems
depends: [],
// More images: http://images.azk.io
image: {"docker": "node:5.7"},
// Steps to execute before running instances
provision: [
"npm install",
// clean transpiled and rebuild
"gulp assets:clean",
"gulp assets",
],
workdir: "/azk/app",
shell: "/bin/bash",
command: [ "npm", "start" ],
mounts: {
'/azk/app' : sync("."),
'/azk/app/node_modules': persistent("./node_modules"),
'/azk/app/build' : persistent("./build"),
},
http: {
domains: [ "#{system.name}.app.#{azk.default_domain}" ]
},
ports: {
http: "35729/tcp",
},
envs: {
// Make sure that the PORT value is the same as the one
// in ports/http below, and that it's also the same
// if you're setting it in a .env file
PATH: "/azk/app/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
NODE_ENV: "dev",
TERM: "xterm-256color",
FORCE_COLOR: true,
},
},
});
setDefault('app');
server {
listen 8008;
server_name localhost;
root /azk/app/build;
index index.html;
error_log /dev/stdout info;
access_log /dev/stdout;
location / {
try_files $uri $uri/ /index.html;
}
location /assets {
# only use autoindex in development
autoindex on;
alias /azk/app/build/assets;
}
location /livereload {
proxy_pass http://builder.app.dev.azk.io;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment