-
-
Save durango/6f8800709af8d8a96812 to your computer and use it in GitHub Desktop.
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
// Adds the systems that shape your system | |
systems({ | |
'gambit': { | |
depends: ["postgres","redis"], | |
image: "jamesgroat/golang-nodejs", | |
// Steps to execute before running instances | |
provision: [ | |
"npm install", | |
"npm install -g less", | |
"mkdir /gopath/bin", | |
"mkdir -p /goroot/src/pkg/", | |
"mkdir -p /gopath/src/github.com/durango/gambit/", | |
"go get -u bitbucket.org/liamstask/goose/cmd/goose", | |
"go get -u github.com/codegangsta/gin", | |
"go get -u github.com/tools/godep", | |
"go get -u gopkg.in/godo.v1/cmd/godo", | |
"godep restore", | |
'goose -env="local" up' | |
], | |
wait: true, | |
balancer: true, | |
shell : '/bin/bash', | |
workdir: "/gopath/src/github.com/durango/gambit/", | |
command: "godo server less --watch", | |
mounts: { | |
// Mounts folders to assigned paths | |
"/gopath/src/github.com/durango/gambit": path("."), | |
}, | |
scalable: {default: 2}, | |
// Set hostname to use in http balancer | |
http: { | |
// node-example.dev.azk.io | |
domains: [ "#{system.name}.#{azk.default_domain}" ], | |
}, | |
envs: { | |
// Exports global variables | |
NODE_ENV: "local", | |
GOPATH: '/gopath', | |
GOROOT: '/goroot' | |
}, | |
ports: { | |
http: "3000/tcp", | |
}, | |
}, | |
redis: { | |
image: "redis", | |
mounts: { | |
"/data-redis": persistent("data-redis-#{system.name}"), | |
}, | |
ports: { | |
data: "6379/tcp", | |
}, | |
export_envs: { | |
REDIS_URL: "redis://#{net.host}:#{net.port.data}/database", | |
}, | |
}, | |
postgres: { | |
image : 'wyaeld/postgres:9.3', | |
mounts : { | |
'/var/lib/postgresql' : {type: 'persistent', value: 'postgresql'}, | |
'/var/log/postgresql' : {type: 'path', value: './log/postgresql'}, | |
}, | |
balancer: false, | |
http: false, | |
command: null, | |
workdir: null, | |
ports: { | |
data: "5432/tcp", | |
}, | |
envs: { | |
POSTGRESQL_USER: "local", | |
POSTGRESQL_PASS: "local", | |
POSTGRESQL_DB : "postgres_development", | |
POSTGRESQL_HOST: "#{net.host}", | |
POSTGRESQL_PORT: "#{net.port.data}", | |
}, | |
export_envs: { | |
DATABASE_URL: "postgres://#{envs.POSTGRESQL_USER}:#{envs.POSTGRESQL_PASS}@#{net.host}:#{net.port.data}/${envs.POSTGRESQL_DB}", | |
}, | |
}, | |
}); | |
setDefault("gambit"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment