-
-
Save gullitmiranda/53b4cdf8a52507f9d73c to your computer and use it in GitHub Desktop.
Feedbin Azkfile.js
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
/** | |
* Documentation: http://docs.azk.io/Azkfile.js | |
*/ | |
// Adds the systems that shape your system | |
systems({ | |
feedbin: { | |
// Dependent systems | |
depends: ["redis", "postgres"], | |
// More images: http://images.azk.io | |
image: {"docker": "azukiapp/ruby:2.1.4"}, | |
// Steps to execute before running instances | |
provision: [ | |
"bundle install --path /azk/bundler", | |
"rake db:setup", | |
], | |
workdir: "/azk/#{manifest.dir}", | |
shell: "/bin/bash", | |
command: "bundle exec rackup config.ru --pid /tmp/ruby.pid --port $HTTP_PORT --host 0.0.0.0", | |
//command: "bundle exec foreman start --port $HTTP_PORT", | |
wait: {"retry": 40, "timeout": 10000}, | |
mounts: { | |
'/azk/#{manifest.dir}': path("."), | |
'/azk/bundler': persistent("bundler"), | |
}, | |
scalable: {"default": 1}, | |
http: { | |
domains: [ "#{system.name}.#{azk.default_domain}" ] | |
}, | |
envs: { | |
// set instances variables | |
RUBY_ENV: "development", | |
BUNDLE_APP_CONFIG: "/azk/bundler", | |
}, | |
}, | |
worker: { | |
extends: 'feedbin', | |
command: 'bundle exec sidekiq -c 12 -q critical,2 -q feed_refresher_receiver,1 -q default', | |
scalable: { limit: 1, default: 1}, | |
http: null, | |
envs: { | |
DB_POOL: 12, | |
LIBRATO_AUTORUN: 1 | |
} | |
}, | |
worker_slow: { | |
extends: 'feedbin', | |
command: 'bundle exec sidekiq -c 1 -q worker_slow_critical,3 -q worker_slow,2 -q favicon,1', | |
scalable: { default: 1, limit: 1 }, | |
http: null, | |
envs: { | |
DB_POOL: 1 | |
} | |
}, | |
clock: { | |
extends: 'feedbin', | |
command: 'bundle exec clockwork lib/clock.rb', | |
scalable: { default: 1, limit: 1 }, | |
http: null, | |
}, | |
redis: { | |
image: {"docker": "redis"}, | |
export_envs: { | |
"DATABASE_URL": "redis://#{net.host}:#{net.port[6379]}", | |
}, | |
}, | |
postgres: { | |
// Dependent systems | |
depends: [], | |
// More images: http://images.azk.io | |
image: {"docker": "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 | |
data: "5432/tcp", | |
}, | |
envs: { | |
// set instances variables | |
POSTGRESQL_USER: "azk", | |
POSTGRESQL_PASS: "azk", | |
POSTGRESQL_DB: "postgres_development", | |
POSTGRESQL_HOST: "#{net.host}", | |
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.data}/${envs.POSTGRESQL_DB}", | |
}, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment