Skip to content

Instantly share code, notes, and snippets.

@gullitmiranda
Created June 16, 2015 21:56
Show Gist options
  • Select an option

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

Select an option

Save gullitmiranda/b500103504f69d77223e to your computer and use it in GitHub Desktop.
# Mix artifacts
/_build
/deps
/*.ez
# Generate on crash by the VM
erl_crash.dump
# Static artifacts
/node_modules
# Since we are building js and css from web/static,
# we ignore priv/static/{css,js}. You may want to
# comment this depending on your deployment strategy.
/priv/static/css
/priv/static/js
# The config/prod.secret.exs file by default contains sensitive
# data and you should not commit it into version control.
#
# Alternatively, you may comment the line below and commit the
# secrets file as long as you replace its contents by environment
# variables.
/config/prod.secret.exs
/**
* Documentation: http://docs.azk.io/Azkfile.js
*/
// Adds the systems that shape your system
systems({
app: {
// Dependent systems
depends: ['postgres'],
// More images: http://images.azk.io
image: {"docker": "azukiapp/elixir"},
// Steps to execute before running instances
provision: [
"npm install",
"mix do deps.get, compile",
"mix ecto.create",
"mix ecto.migrate",
],
workdir: "/azk/#{manifest.dir}/app",
shell: "/bin/bash",
command: "mix phoenix.server --no-deps-check",
wait: {"retry": 20, "timeout": 1000},
mounts: {
'/root/.hex': path(env.HOME + '/.hex'),
'/azk/#{manifest.dir}/#{system.name}/deps': persistent("#{manifest.dir}/#{system.name}/deps"),
'/azk/#{manifest.dir}/#{system.name}/_build': persistent("#{manifest.dir}/#{system.name}/_build"),
'/azk/#{manifest.dir}/#{system.name}/node_modules': persistent("#{manifest.dir}/#{system.name}/node_modules"),
'/azk/#{manifest.dir}/#{system.name}/priv/static/js': persistent("#{manifest.dir}/#{system.name}/priv/static/js"),
'/azk/#{manifest.dir}/#{system.name}/priv/static/css': persistent("#{manifest.dir}/#{system.name}/priv/static/css"),
'/azk/#{manifest.dir}/app': sync("./app"),
},
scalable: {"default": 1},
http: {
domains: [ "#{system.name}.#{azk.default_domain}" ]
},
ports: {
// exports global variables
http: "4000",
},
envs: {
// set instances variables
MIX_ENV: "dev",
},
},
postgres: {
// Dependent systems
depends: [], // postgres, postgres, mongodb ...
// More images: http://images.azk.io
image: {"docker": "azukiapp/postgres"},
shell: "/bin/bash",
wait: {"retry": 25, "timeout": 1000},
mounts: {
'/var/lib/postgresql/data': persistent("postgresql"),
'/var/log/postgresql': path("./log/postgresql"),
},
ports: {
// exports global variables
data: "5432/tcp",
},
envs: {
// set instances variables
POSTGRES_USER: "azk",
POSTGRES_PASS: "azk",
POSTGRES_DB : "#{manifest.dir}_development",
},
export_envs: {
// check this gist to configure your database
// https://github.com/azukiapp/hello_phoenix/blob/master/config/config.exs#L22
DATABASE_URL: "ecto+postgres://#{envs.POSTGRES_USER}:#{envs.POSTGRES_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRES_DB}?size=10",
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment