Skip to content

Instantly share code, notes, and snippets.

@lucasprag
Forked from gullitmiranda/Azkfile.js
Last active August 29, 2015 14:20
Show Gist options
  • Save lucasprag/a3f2c6767a2383df367a to your computer and use it in GitHub Desktop.
Save lucasprag/a3f2c6767a2383df367a to your computer and use it in GitHub Desktop.

Revisions

  1. @gullitmiranda gullitmiranda revised this gist Apr 27, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions Azkfile.js
    Original file line number Diff line number Diff line change
    @@ -40,15 +40,15 @@ systems({
    },
    },
    redis: {
    image: 'redis:2.6',
    image: { docker: 'redis:2.6' },
    shell: '/bin/bash',
    ports: {
    // exports global variables
    portA: "6379:6379/tcp",
    },
    },
    elasticsearch: {
    image: 'dockerfile/elasticsearch',
    image: { docker: 'dockerfile/elasticsearch' },
    shell: '/bin/bash',
    wait: {"retry": 50, "timeout": 1000},
    ports: {
    @@ -64,7 +64,7 @@ systems({
    // Dependent systems
    depends: [], // postgres, postgres, mongodb ...
    // More images: http://images.azk.io
    image: {"docker": "azukiapp/postgres"},
    image: { "docker": "azukiapp/postgres"} ,
    shell: "/bin/bash",
    wait: {"retry": 25, "timeout": 1000},
    mounts: {
  2. @gullitmiranda gullitmiranda renamed this gist Apr 27, 2015. 1 changed file with 11 additions and 15 deletions.
    26 changes: 11 additions & 15 deletions gistfile1.txt → Azkfile.js
    Original file line number Diff line number Diff line change
    @@ -8,14 +8,12 @@ systems({
    // Dependent systems
    depends: ["postgres", "redis", "elasticsearch"],
    // More images: http://images.azk.io
    image: "gullitmiranda/ruby",
    image: { docker: "azukiapp/ruby" },
    // Steps to execute before running instances
    provision: [
    "bundle install --path /azk/bundler",
    "bundle exec rake db:create",
    "bundle exec rake db:migrate",
    "apt-get update",
    "apt-get install nodejs -y",
    "npm install -g bower",
    "bower install --save",
    ],
    @@ -29,7 +27,7 @@ systems({
    },
    scalable: {"default": 1},
    http: {
    // magnetis.
    // magnetis.dev.azk.io
    domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    envs: {
    @@ -64,33 +62,31 @@ systems({
    },
    postgres: {
    // Dependent systems
    depends: [],
    depends: [], // postgres, postgres, mongodb ...
    // More images: http://images.azk.io
    image: "azukiapp/postgres:9.3",
    image: {"docker": "azukiapp/postgres"},
    shell: "/bin/bash",
    wait: {"retry": 20, "timeout": 1000},
    wait: {"retry": 25, "timeout": 1000},
    mounts: {
    '/var/lib/postgresql': persistent("postgresql"),
    '/var/lib/postgresql': persistent("postgresql-#{system.name}"),
    '/var/log/postgresql': path("./log/postgresql"),
    },
    ports: {
    // exports global variables
    portA: "5432:5432/tcp",
    data: "5432/tcp",
    },
    envs: {
    // set instances variables
    POSTGRESQL_USER: "azk",
    POSTGRESQL_PASS: "azk",
    POSTGRESQL_DB: "#{manifest.dir}_development",
    POSTGRESQL_DB : "#{system.name}_development",
    POSTGRESQL_HOST: "#{net.host}",
    POSTGRESQL_PORT: "#{net.port.portA}",
    POSTGRESQL_PORT: "#{net.port.data}",
    },
    export_envs: {
    // check this gist to configure your database
    // https://gist.github.com/gullitmiranda/62082f2e47c364ef9617
    DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.portA}/${envs.POSTGRESQL_DB}",
    DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRESQL_DB}",
    },
    },
    }
    });


  3. lucasprag created this gist Apr 27, 2015.
    96 changes: 96 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,96 @@
    /**
    * Documentation: http://docs.azk.io/Azkfile.js
    */

    // Adds the systems that shape your system
    systems({
    magnetis: {
    // Dependent systems
    depends: ["postgres", "redis", "elasticsearch"],
    // More images: http://images.azk.io
    image: "gullitmiranda/ruby",
    // Steps to execute before running instances
    provision: [
    "bundle install --path /azk/bundler",
    "bundle exec rake db:create",
    "bundle exec rake db:migrate",
    "apt-get update",
    "apt-get install nodejs -y",
    "npm install -g bower",
    "bower install --save",
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: "bundle exec rails server --pid /tmp/rails.pid --port $HTTP_PORT",
    wait: {"retry": 50, "timeout": 1000},
    mounts: {
    '/azk/#{manifest.dir}': path("."),
    '/azk/bundler': persistent("bundler"),
    },
    scalable: {"default": 1},
    http: {
    // magnetis.
    domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    envs: {
    // set instances variables
    //HTTP_PORT: 8080,
    RUBY_ENV: "development",
    RAILS_ENV: "development",
    BUNDLE_APP_CONFIG: "/azk/bundler",
    GITHUB_TOKEN: "a0f1bfee54440fa767266b76cd5169f01b4c2634",
    },
    },
    redis: {
    image: 'redis:2.6',
    shell: '/bin/bash',
    ports: {
    // exports global variables
    portA: "6379:6379/tcp",
    },
    },
    elasticsearch: {
    image: 'dockerfile/elasticsearch',
    shell: '/bin/bash',
    wait: {"retry": 50, "timeout": 1000},
    ports: {
    // exports global variables
    portA: "9200/http",
    portB: "9300/tcp",
    },
    export_envs: {
    ELASTICSEARCH_URL: "http://#{net.host}:#{net.port.portA}",
    }
    },
    postgres: {
    // Dependent systems
    depends: [],
    // More images: http://images.azk.io
    image: "azukiapp/postgres:9.3",
    shell: "/bin/bash",
    wait: {"retry": 20, "timeout": 1000},
    mounts: {
    '/var/lib/postgresql': persistent("postgresql"),
    '/var/log/postgresql': path("./log/postgresql"),
    },
    ports: {
    // exports global variables
    portA: "5432:5432/tcp",
    },
    envs: {
    // set instances variables
    POSTGRESQL_USER: "azk",
    POSTGRESQL_PASS: "azk",
    POSTGRESQL_DB: "#{manifest.dir}_development",
    POSTGRESQL_HOST: "#{net.host}",
    POSTGRESQL_PORT: "#{net.port.portA}",
    },
    export_envs: {
    // check this gist to configure your database
    // https://gist.github.com/gullitmiranda/62082f2e47c364ef9617
    DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.portA}/${envs.POSTGRESQL_DB}",
    },
    },
    });