Last active
August 29, 2015 14:15
-
-
Save gullitmiranda/e9c76d35746b432d2063 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
*/ | |
systems({ | |
"msmm-front": { | |
depends: [ | |
'msmm-api' | |
], | |
image: { docker: "azukiapp/ruby:2.1"}, | |
provision: [ | |
"bundle install", | |
], | |
workdir: "/azk/#{manifest.dir}", | |
command: "bundle exec thin start", | |
shell: "/bin/bash", | |
mounts: { | |
"/azk/#{manifest.dir}": path('msmm-web'), | |
"/azk/bundler": persistent('bundler'), | |
}, | |
scalable: {"default": 1}, | |
http: { | |
domains: ["#{system.name}.#{azk.default_domain}"] | |
}, | |
ports: { | |
http: "3000/tcp", | |
}, | |
envs: { | |
RUBY_ENV: "development", | |
RACK_ENV: "development", | |
RAILS_ENV: "development", | |
ENABLE_AZK: true, | |
HOST: "#{system.name}.#{azk.default_domain}", | |
}, | |
export_envs: { | |
HTTP_PORT: "#{azk.default_domain}:#{net.port.http}", | |
HTTPS_PORT: "#{azk.default_domain}:#{net.port.http}", | |
} | |
}, | |
"msmm-api": { | |
depends: [ | |
'redis', 'postgres' | |
], | |
image: { docker: "azukiapp/ruby:2.1"}, | |
provision: [ | |
"bundle install", | |
// "bundle exec rake db:migrate db:test:prepare", | |
"bundle exec rake db:seed", | |
"rake test:prepare", | |
// "bundle exec rspec spec" | |
], | |
workdir: "/azk/#{manifest.dir}", | |
command: "bundle exec rackup", | |
shell: "/bin/bash", | |
mounts: { | |
"/azk/#{manifest.dir}": path('msmm-api'), | |
"/azk/bundler": persistent('bundler'), | |
}, | |
scalable: {"default": 1}, | |
http: { | |
domains: ["#{system.name}.#{azk.default_domain}"] | |
}, | |
ports: { | |
http: "9292/tcp", | |
}, | |
envs: { | |
RUBY_ENV: "development", | |
RACK_ENV: "development", | |
RAILS_ENV: "development", | |
ENABLE_AZK: true, | |
HOST: "#{system.name}.#{azk.default_domain}", | |
}, | |
export_envs: { | |
API_HTTP_PORT: "#{azk.default_domain}:#{net.port.http}", | |
API_HTTPS_PORT: "#{azk.default_domain}:#{net.port.http}", | |
} | |
}, | |
redis: { | |
image: { docker: "redis:2.8"}, | |
scalable: false, | |
mounts: { | |
"/data": persistent('redis') | |
}, | |
ports: { | |
data: "6379/tcp" | |
}, | |
envs: {}, | |
export_envs: { | |
REDIS_URL: "redis://#{net.host}:#{net.port.data}/database", | |
} | |
}, | |
postgres: { | |
image: {"docker": "azukiapp/postgres:9.4"}, | |
shell: "/bin/bash", | |
wait: {"retry": 25, "timeout": 1000}, | |
mounts: { | |
'/var/lib/postgresql': persistent("postgresql-#{system.name}"), | |
'/var/log/postgresql': path("./log/postgresql"), | |
}, | |
ports: { | |
data: "5432/tcp", | |
}, | |
envs: { | |
POSTGRESQL_USER: "azk", | |
POSTGRESQL_PASS: "azk", | |
POSTGRESQL_DB: "msmm_development", | |
POSTGRESQL_HOST: "#{net.host}", | |
POSTGRESQL_PORT: "#{net.port.data}", | |
}, | |
export_envs: { | |
DATABASE_USER: "#{envs.POSTGRESQL_USER}", | |
DATABASE_PASS: "#{envs.POSTGRESQL_PASS}", | |
DATABASE_HOST: "#{net.host}", | |
DATABASE_PORT: "#{net.port.data}", | |
DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRESQL_DB}", | |
}, | |
}, | |
}); | |
setDefault("msmm-front"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment