Skip to content

Instantly share code, notes, and snippets.

@lsdr
Last active August 29, 2015 14:13
Show Gist options
  • Save lsdr/225a8ed745ba8973b2bb to your computer and use it in GitHub Desktop.
Save lsdr/225a8ed745ba8973b2bb to your computer and use it in GitHub Desktop.
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
kooljobs: {
shell: "/bin/bash",
// Dependent systems
depends: ["redis"],
// More images: http://images.azk.io
image: "ruby:latest",
// Steps to execute before running instances
provision: [
"bundle install --path /bundler",
],
workdir: "/azk/#{manifest.dir}",
command: "bundle exec rackup config.ru --port $HTTP_PORT",
mounts: {
'/azk/#{manifest.dir}': path("."),
'/bundler': persistent("bundler"),
},
scalable: {"default": 2},
http: {
// kooljobs.
domains: [ "#{system.name}.#{azk.default_domain}" ]
},
envs: {
// set instances variables
RUBY_ENV: "dev",
BUNDLE_APP_CONFIG: "/bundler",
},
},
redis: {
image: "redis:latest",
mounts: {
'/data': persistent("redis"),
},
ports: {
redis: "6379/tcp",
},
export_envs: {
REDISCLOUD_URL: "redis://#{net.host}:#{net.port.redis}"
},
},
});
$ azk start --reprovision
azk: ↑ starting `redis` system, 1 new instances...
azk: ✓ checking `redis:latest` image...
azk: ◴ waiting start `redis` system, try connect port redis/tcp...
azk: ↑ starting `kooljobs` system, 2 new instances...
azk: ✓ checking `ruby:latest` image...
azk: ↻ provisioning `kooljobs` system...
azk: ◴ waiting start `kooljobs` system, try connect port http/tcp...
azk: Run system `kooljobs` return: (0), for command: /bin/bash -c bundle exec rackup config.ru --port $HTTP_PORT:
azk: [2015-01-07 19:35:18] INFO WEBrick 1.3.1
azk: [2015-01-07 19:35:18] INFO ruby 2.2.0 (2014-12-25) [x86_64-linux]
azk: [2015-01-07 19:35:18] INFO WEBrick::HTTPServer#start: pid=1 port=5000
azk: Due to the above error azk will stop all instances already begun.
azk: System `kooljobs` not running
azk: ↓ stopping `redis` system, 1 instances...
┌───┬──────────┬────────────┬──────────────────┬─────────────────┬───────────────────┐
│ │ System │ Instancies │ Hostname │ Instances-Ports │ Provisioned │
├───┼──────────┼────────────┼──────────────────┼─────────────────┼───────────────────┤
│ ↓ │ kooljobs │ 0 │ kooljobs.azk.dev │ - │ a few seconds ago │
├───┼──────────┼────────────┼──────────────────┼─────────────────┼───────────────────┤
│ ↓ │ redis │ 0 │ azk.dev │ - │ - │
└───┴──────────┴────────────┴──────────────────┴─────────────────┴───────────────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment