Last active
August 29, 2015 14:01
-
-
Save drnic/1dfcb454b4e27a87e321 to your computer and use it in GitHub Desktop.
trying to deploy ghost to cloud foundry
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
// # Ghost Configuration | |
// Setup your Ghost install for various environments | |
// Documentation can be found at http://docs.ghost.org/usage/configuration/ | |
var path = require('path'), | |
config, mysql; | |
var cfEnv = require("cf-env"); | |
var pkg = require("./package.json"); | |
var cfCore = cfEnv.getCore({name: pkg.name}); | |
// var sql = cfEnv.getService("spark"); | |
var sql = cfEnv.getService("drnic-ghost-pg"); | |
// var mysql = {}; | |
// console.log(cfEnv); | |
// console.log(cfCore); | |
// console.log(cfEnv.getServices()); | |
// console.log(sql); | |
// https://github.com/brianc/node-postgres/issues/557 | |
require('pg').defaults.poolSize = 4 | |
config = { | |
// ### Development **(default)** | |
development: { | |
// The url to use when providing links to the site, E.g. in RSS and email. | |
url: 'http://my-ghost-blog.com', | |
// Example mail config | |
// Visit http://docs.ghost.org/mail for instructions | |
// ``` | |
// mail: { | |
// transport: 'SMTP', | |
// options: { | |
// service: 'Mailgun', | |
// auth: { | |
// user: '', // mailgun username | |
// pass: '' // mailgun password | |
// } | |
// } | |
// }, | |
// ``` | |
database: { | |
client: 'sqlite3', | |
connection: { | |
filename: path.join(__dirname, '/content/data/ghost-dev.db') | |
}, | |
debug: false | |
}, | |
server: { | |
// Host to be passed to node's `net.Server#listen()` | |
host: '127.0.0.1', | |
// Port to be passed to node's `net.Server#listen()`, for iisnode set this to `process.env.PORT` | |
port: '2368' | |
}, | |
paths: { | |
contentPath: path.join(__dirname, '/content/') | |
} | |
}, | |
// ### Production | |
// When running Ghost in the wild, use the production environment | |
// Configure your URL and mail settings here | |
production: { | |
url: cfCore.url, | |
mail: {}, | |
mysql_database: { | |
client: 'mysql', | |
connection: { | |
// https://github.com/felixge/node-mysql#connection-options | |
database: sql.credentials.name, | |
host: sql.credentials.hostname, | |
port: sql.credentials.port, | |
user: sql.credentials.username, | |
password: sql.credentials.password, | |
charset : 'utf8', | |
connectionLimit: 4 // limit of the free cleardb spark plan | |
} | |
}, | |
database: { | |
client: 'pg', | |
// https://github.com/brianc/node-postgres/wiki/Client#new-clientstring-domainsocketfolder-client | |
connection: sql.credentials.uri | |
}, | |
server: { | |
host: cfCore.bind, | |
port: cfCore.port | |
}, | |
logging: false | |
}, | |
}; | |
console.log(config.production) | |
// Export config | |
module.exports = config; |
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
web: NODE_ENV=production npm start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment